public class LongSum extends Object implements CombinerAggregator<Number,Long,Long>
Computes the long sum of the input values.
Constructor and Description |
---|
LongSum() |
Modifier and Type | Method and Description |
---|---|
Long |
apply(Long aggregate,
Number value)
Updates the accumulator by applying the current accumulator with the value.
|
Long |
init()
The initial value of the accumulator to start with.
|
Long |
merge(Long accum1,
Long accum2)
Merges two accumulators and returns the merged accumulator.
|
Long |
result(Long accum)
Produces a result value out of the accumulator.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
of
public Long init()
CombinerAggregator
The initial value of the accumulator to start with.
init
in interface CombinerAggregator<Number,Long,Long>
public Long apply(Long aggregate, Number value)
CombinerAggregator
Updates the accumulator by applying the current accumulator with the value.
apply
in interface CombinerAggregator<Number,Long,Long>
aggregate
- the current accumulatorvalue
- the valuepublic Long merge(Long accum1, Long accum2)
CombinerAggregator
Merges two accumulators and returns the merged accumulator.
merge
in interface CombinerAggregator<Number,Long,Long>
accum1
- the first accumulatoraccum2
- the second accumulatorpublic Long result(Long accum)
CombinerAggregator
Produces a result value out of the accumulator.
result
in interface CombinerAggregator<Number,Long,Long>
accum
- the accumulatorCopyright © 2019 The Apache Software Foundation. All rights reserved.