com.datasalt.pangool.tuplemr
Class TupleRollupReducer<OUTPUT_KEY,OUTPUT_VALUE>

java.lang.Object
  extended by com.datasalt.pangool.tuplemr.TupleReducer<OUTPUT_KEY,OUTPUT_VALUE>
      extended by com.datasalt.pangool.tuplemr.TupleRollupReducer<OUTPUT_KEY,OUTPUT_VALUE>
All Implemented Interfaces:
Serializable

public class TupleRollupReducer<OUTPUT_KEY,OUTPUT_VALUE>
extends TupleReducer<OUTPUT_KEY,OUTPUT_VALUE>

Similar to TupleReducer but added functionality to be used with rollup

See Also:
RollupReducer, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.datasalt.pangool.tuplemr.TupleReducer
TupleReducer.Collector, TupleReducer.CombinerCollector, TupleReducer.StaticCollector<OUTPUT_KEY,OUTPUT_VALUE,CONTEXT_OUTPUT_KEY,CONTEXT_OUTPUT_VALUE>, TupleReducer.TupleMRContext
 
Constructor Summary
TupleRollupReducer()
           
 
Method Summary
 void onCloseGroup(int depth, String field, ITuple lastElement, TupleReducer.TupleMRContext context, TupleReducer.Collector collector)
          This is the method called after every sub-group is being closed when rollup is used.
 void onOpenGroup(int depth, String field, ITuple firstElement, TupleReducer.TupleMRContext context, TupleReducer.Collector collector)
          This is the method called any time that a sub-group is opened when rollup is used.
 
Methods inherited from class com.datasalt.pangool.tuplemr.TupleReducer
cleanup, reduce, setup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TupleRollupReducer

public TupleRollupReducer()
Method Detail

onOpenGroup

public void onOpenGroup(int depth,
                        String field,
                        ITuple firstElement,
                        TupleReducer.TupleMRContext context,
                        TupleReducer.Collector collector)
                 throws IOException,
                        InterruptedException,
                        TupleMRException
This is the method called any time that a sub-group is opened when rollup is used. Check TupleMRBuilder doc about how roll-up feature works

Parameters:
depth - The tuple's field index that is currently being opened.0 when it's the first field
field - The tuple's field name that is currently being opened.
firstElement - The first tuple from the current group
context - The reducer context as in Reducer
Throws:
IOException
InterruptedException
TupleMRException

onCloseGroup

public void onCloseGroup(int depth,
                         String field,
                         ITuple lastElement,
                         TupleReducer.TupleMRContext context,
                         TupleReducer.Collector collector)
                  throws IOException,
                         InterruptedException,
                         TupleMRException
This is the method called after every sub-group is being closed when rollup is used. Check TupleMRBuilder doc about how roll-up feature works

Parameters:
depth - The tuple's field index that is currently being opened.It's 0 when it's the first field
field - The tuple's field name that is currently being opened.
lastElement - The last tuple from the current group
context - The reducer context as in Reducer
Throws:
IOException
InterruptedException
TupleMRException


Copyright © –2014 Datasalt Systems S.L.. All rights reserved.