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

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.Max
All Implemented Interfaces:
java.io.Serializable, org.apache.hadoop.conf.Configurable

public class Max
extends SingleInputAggregateFunction

Calculates the maximum value of the given inputColumn in Max(Column) in a group.

By default, TupleColumnComparator is used to compare two different values. For different ordering, use SerializableComparator in #Max(Column, SerializableComparator).

This product is licensed under the Apache License, Version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0. This product contains portions derived from Apache hadoop which is licensed under the Apache License, Version 2.0, available at http://hadoop.apache.org. © 2007 – 2012 eBay Inc., Evan Chiu, Woody Zhou, Neel Sundaresan

See Also:
Serialized Form

Field Summary
protected  TupleColumnComparator _comparator
          The default comparator.
protected  java.util.Comparator<java.lang.Object> _user_specified_comparator
          user specified comparator.
protected  java.lang.String _user_specified_comparator_clazz
          the full class name of user specified comparator, specified in Max(Column, Comparator)
protected  byte valueType
          the type of the value of the input column
 
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
Max(Column inputColumn)
          Create an instance of Max operation to get the maximum value of the given inputColumn within a group.
Max(Column inputColumn, java.util.Comparator<java.lang.Object> comparator)
          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.
 
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, reset
 
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
 

Field Detail

_comparator

protected transient TupleColumnComparator _comparator
The default comparator.

Use TupleColumnComparator so it is possible to compare values in different but exchangeable type, ex: comparing integer with double.


valueType

protected byte valueType
the type of the value of the input column


_user_specified_comparator_clazz

protected java.lang.String _user_specified_comparator_clazz
the full class name of user specified comparator, specified in Max(Column, Comparator)


_user_specified_comparator

protected transient java.util.Comparator<java.lang.Object> _user_specified_comparator
user specified comparator.

Constructor Detail

Max

public Max(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.


Max

public Max(Column inputColumn,
           java.util.Comparator<java.lang.Object> comparator)
Create an instance of Max operation to get the maximum value of the given inputColumn within a group.

The comparing is done by user specified comparator.

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

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