Class LongSum
- java.lang.Object
-
- org.apache.storm.streams.operations.aggregators.LongSum
-
- All Implemented Interfaces:
Serializable,CombinerAggregator<Number,Long,Long>,Operation
public class LongSum extends Object implements CombinerAggregator<Number,Long,Long>
Computes the long sum of the input values.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LongSum()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Longapply(Long aggregate, Number value)Updates the accumulator by applying the current accumulator with the value.Longinit()The initial value of the accumulator to start with.Longmerge(Long accum1, Long accum2)Merges two accumulators and returns the merged accumulator.Longresult(Long accum)Produces a result value out of the accumulator.
-
-
-
Method Detail
-
init
public Long init()
Description copied from interface:CombinerAggregatorThe initial value of the accumulator to start with.- Specified by:
initin interfaceCombinerAggregator<Number,Long,Long>- Returns:
- the initial value of the accumulator
-
apply
public Long apply(Long aggregate, Number value)
Description copied from interface:CombinerAggregatorUpdates the accumulator by applying the current accumulator with the value.- Specified by:
applyin interfaceCombinerAggregator<Number,Long,Long>- Parameters:
aggregate- the current accumulatorvalue- the value- Returns:
- the updated accumulator
-
merge
public Long merge(Long accum1, Long accum2)
Description copied from interface:CombinerAggregatorMerges two accumulators and returns the merged accumulator.- Specified by:
mergein interfaceCombinerAggregator<Number,Long,Long>- Parameters:
accum1- the first accumulatoraccum2- the second accumulator- Returns:
- the merged accumulator
-
result
public Long result(Long accum)
Description copied from interface:CombinerAggregatorProduces a result value out of the accumulator.- Specified by:
resultin interfaceCombinerAggregator<Number,Long,Long>- Parameters:
accum- the accumulator- Returns:
- the result
-
-