com.ebay.erl.mobius.core.function
Class Sum

java.lang.Object
  extended by com.ebay.erl.mobius.core.function.base.Projectable
      extended by com.ebay.erl.mobius.core.function.base.GroupFunction
          extended by com.ebay.erl.mobius.core.function.base.AggregateFunction
              extended by com.ebay.erl.mobius.core.function.base.SingleInputAggregateFunction
                  extended by com.ebay.erl.mobius.core.function.Sum
All Implemented Interfaces:
java.io.Serializable, org.apache.hadoop.conf.Configurable

public class Sum
extends SingleInputAggregateFunction

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ebay.erl.mobius.core.function.base.SingleInputAggregateFunction
inputColumnName
 
Fields inherited from class com.ebay.erl.mobius.core.function.base.AggregateFunction
aggregateResult
 
Fields inherited from class com.ebay.erl.mobius.core.function.base.GroupFunction
rowsToBeOutputted
 
Fields inherited from class com.ebay.erl.mobius.core.function.base.Projectable
conf, hashCode, inputs, outputSchema, reporter, requireDataFromMultiDatasets
 
Constructor Summary
Sum(Column inputColumn)
          Create an instance of Max operation to get the maximum value of the given inputColumn within a group.
 
Method Summary
 void consume(Tuple tuple)
          consume a value within a group, to be implemented by sub-class.
 boolean isCombinable()
          Determine this function can be run in a combiner or not, default is false.
 void reset()
          Empty previous result (rowsToBeOutputted), reset is called when the values within a group have been all iterated.
 
Methods inherited from class com.ebay.erl.mobius.core.function.base.SingleInputAggregateFunction
getComputedResult
 
Methods inherited from class com.ebay.erl.mobius.core.function.base.AggregateFunction
getResult, newBigTupleList, output
 
Methods inherited from class com.ebay.erl.mobius.core.function.base.GroupFunction
getNoMatchResult, getRowsToBeOutputted
 
Methods inherited from class com.ebay.erl.mobius.core.function.base.Projectable
calledByCombiner, equals, getConf, getInputColumns, getOutputSchema, getParticipatedDataset, hashCode, init, requireDataFromMultiDatasets, setCalledByCombiner, setConf, setOutputSchema, setReporter, toString, useGroupKeyOnly
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Sum

public Sum(Column inputColumn)
Create an instance of Max operation to get the maximum value of the given inputColumn within a group.

The comparing is natural ordering.

Method Detail

consume

public void consume(Tuple tuple)
Description copied from class: GroupFunction
consume a value within a group, to be implemented by sub-class.

Specified by:
consume in class GroupFunction

reset

public void reset()
Description copied from class: GroupFunction
Empty previous result (rowsToBeOutputted), reset is called when the values within a group have been all iterated.

It is important to call super.reset() when override this method in a sub-class, fail to do so, will result in wrong result.

Overrides:
reset in class AggregateFunction

isCombinable

public final boolean isCombinable()
Description copied from class: Projectable
Determine this function can be run in a combiner or not, default is false.

Overrides:
isCombinable in class Projectable