public class Count<T> extends Object implements CombinerAggregator<T,Long,Long>
Computes the count of values.
| Constructor and Description |
|---|
Count() |
| Modifier and Type | Method and Description |
|---|---|
Long |
apply(Long accum,
T 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, waitofpublic Long init()
CombinerAggregatorThe initial value of the accumulator to start with.
init in interface CombinerAggregator<T,Long,Long>public Long apply(Long accum, T value)
CombinerAggregatorUpdates the accumulator by applying the current accumulator with the value.
apply in interface CombinerAggregator<T,Long,Long>accum - the current accumulatorvalue - the valuepublic Long merge(Long accum1, Long accum2)
CombinerAggregatorMerges two accumulators and returns the merged accumulator.
merge in interface CombinerAggregator<T,Long,Long>accum1 - the first accumulatoraccum2 - the second accumulatorpublic Long result(Long accum)
CombinerAggregatorProduces a result value out of the accumulator.
result in interface CombinerAggregator<T,Long,Long>accum - the accumulatorCopyright © 2021 The Apache Software Foundation. All rights reserved.