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, wait
of
public Long init()
CombinerAggregator
The initial value of the accumulator to start with.
init
in interface CombinerAggregator<T,Long,Long>
public Long apply(Long accum, T value)
CombinerAggregator
Updates 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)
CombinerAggregator
Merges 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)
CombinerAggregator
Produces a result value out of the accumulator.
result
in interface CombinerAggregator<T,Long,Long>
accum
- the accumulatorCopyright © 2022 The Apache Software Foundation. All rights reserved.