Class DoubleValueSum
java.lang.Object
org.apache.hadoop.mapreduce.lib.aggregate.DoubleValueSum
- All Implemented Interfaces:
ValueAggregator<String>
- Direct Known Subclasses:
DoubleValueSum
This class implements a value aggregator that sums up a sequence of double
values.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNextValue(double val) add a value to the aggregatorvoidaddNextValue(Object val) add a value to the aggregatordoublegetSum()voidreset()reset the aggregator
-
Constructor Details
-
DoubleValueSum
public DoubleValueSum()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 double value.
-
addNextValue
public void addNextValue(double val) add a value to the aggregator- Parameters:
val- a double value.
-
getReport
- Specified by:
getReportin interfaceValueAggregator<String>- Returns:
- the string representation of the aggregated value
-
getSum
public double getSum()- Returns:
- 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.
-