Class LongValueMax
java.lang.Object
org.apache.hadoop.mapreduce.lib.aggregate.LongValueMax
- All Implemented Interfaces:
ValueAggregator<String>
- Direct Known Subclasses:
LongValueMax
This class implements a value aggregator that maintain the maximum of
a sequence of long values.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNextValue(long newVal) add a value to the aggregatorvoidaddNextValue(Object val) add a value to the aggregatorlonggetVal()voidreset()reset the aggregator
-
Constructor Details
-
LongValueMax
public LongValueMax()the default constructor
-
-
Method Details
-
addNextValue
add a value to the aggregator- Specified by:
addNextValuein interfaceValueAggregator<String>- Parameters:
val- an object whose string representation represents a long value.
-
addNextValue
public void addNextValue(long newVal) add a value to the aggregator- Parameters:
newVal- a long value.
-
getVal
public long getVal()- Returns:
- the aggregated value
-
getReport
- Specified by:
getReportin interfaceValueAggregator<String>- Returns:
- the string representation of the aggregated value
-
reset
public void reset()reset the aggregator- Specified by:
resetin interfaceValueAggregator<String>
-
getCombinerOutput
- Specified by:
getCombinerOutputin interfaceValueAggregator<String>- Returns:
- return an array of one element. The element is a string representation of the aggregated value. The return value is expected to be used by the a combiner.
-