public abstract class AccumulatorEvalFunc<T> extends EvalFunc<T> implements Accumulator<T>
Accumulator
.EvalFunc.SchemaType
log, pigLogger, reporter, returnType
Constructor and Description |
---|
AccumulatorEvalFunc() |
Modifier and Type | Method and Description |
---|---|
abstract void |
accumulate(Tuple b)
Pass tuples to the UDF.
|
abstract void |
cleanup()
Called after getValue() to prepare processing for next key.
|
T |
exec(Tuple input)
This callback method must be implemented by all subclasses.
|
abstract T |
getValue()
Called when all tuples from current key have been passed to accumulate.
|
allowCompileTimeCalculation, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, needEndOfAllInputProcessing, outputSchema, progress, setEndOfAllInput, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
public abstract void accumulate(Tuple b) throws IOException
Accumulator
accumulate
in interface Accumulator<T>
b
- A tuple containing a single field, which is a bag. The bag will contain the set
of tuples being passed to the UDF in this iteration.IOException
public abstract void cleanup()
Accumulator
cleanup
in interface Accumulator<T>
public abstract T getValue()
Accumulator
getValue
in interface Accumulator<T>
public T exec(Tuple input) throws IOException
EvalFunc
exec
in class EvalFunc<T>
input
- the Tuple to be processed.IOException
Copyright © 2007-2012 The Apache Software Foundation