T - the original value typeA - the accumulator typeR - the result typepublic interface CombinerAggregator<T,A,R> extends Operation
| Modifier and Type | Method and Description |
|---|---|
A |
apply(A accumulator,
T value)
Updates the accumulator by applying the current accumulator with the value.
|
A |
init()
The initial value of the accumulator to start with.
|
A |
merge(A accum1,
A accum2)
Merges two accumulators and returns the merged accumulator.
|
static <T,R> CombinerAggregator<T,R,R> |
of(R initialValue,
BiFunction<? super R,? super T,? extends R> accumulator,
BiFunction<? super R,? super R,? extends R> combiner)
A static factory to create a
CombinerAggregator based on initial value, accumulator and combiner. |
R |
result(A accum)
Produces a result value out of the accumulator.
|
static <T,R> CombinerAggregator<T,R,R> of(R initialValue, BiFunction<? super R,? super T,? extends R> accumulator, BiFunction<? super R,? super R,? extends R> combiner)
CombinerAggregator based on initial value, accumulator and combiner.T - the value typeR - the result typeinitialValue - the initial value of the result to start withaccumulator - a function that accumulates values into a partial resultcombiner - a function that combines partially accumulated resultsCombinerAggregatorA init()
A apply(A accumulator, T value)
accumulator - the current accumulatorvalue - the valueA merge(A accum1, A accum2)
accum1 - the first accumulatoraccum2 - the second accumulatorCopyright © 2023 The Apache Software Foundation. All rights reserved.