org.apache.pig
Interface Accumulator<T>

All Known Implementing Classes:
AVG, COUNT, COUNT_STAR, DoubleAvg, DoubleMax, DoubleMin, DoubleSum, FloatAvg, FloatMax, FloatMin, FloatSum, IntAvg, IntMax, IntMin, IntSum, LongAvg, LongMax, LongMin, LongSum, MAX, MIN, StringMax, StringMin, SUM

public interface Accumulator<T>


Method Summary
 void accumulate(Tuple b)
          Pass tuples to the UDF.
 void cleanup()
          Called after getValue() to prepare processing for next key.
 T getValue()
          Called when all tuples from current key have been passed to accumulate.
 

Method Detail

accumulate

void accumulate(Tuple b)
                throws IOException
Pass tuples to the UDF. You can retrive DataBag by calling b.get(index). Each DataBag may contain 0 to many tuples for current key

Throws:
IOException

getValue

T getValue()
Called when all tuples from current key have been passed to accumulate.

Returns:
the value for the UDF for this key.

cleanup

void cleanup()
Called after getValue() to prepare processing for next key.



Copyright © ${year} The Apache Software Foundation