InputT
- type of input valuesAccumT
- type of mutable accumulator valuesOutputT
- type of output valuespublic interface AggregateFn<InputT,AccumT,OutputT>
AggregateFn contains a subset of the functionality of org.apache.beam.sdk.transforms.Combine.CombineFn
.
AggregateFn is experimental. Compatibility is not guaranteed across Beam versions.
Modifier and Type | Method and Description |
---|---|
AccumT |
addInput(AccumT mutableAccumulator,
InputT input)
Adds the given input value to the given accumulator, returning the new accumulator value.
|
AccumT |
createAccumulator()
Returns a new, mutable accumulator value, representing the accumulation of zero input values.
|
OutputT |
extractOutput(AccumT mutableAccumulator)
Returns the output value that is the result of combining all the input values represented by
the given accumulator.
|
AccumT |
mergeAccumulators(AccumT mutableAccumulator,
java.lang.Iterable<AccumT> immutableAccumulators)
Returns an accumulator representing the accumulation of all the input values accumulated in the
merging accumulators.
|
AccumT createAccumulator()
AccumT addInput(AccumT mutableAccumulator, InputT input)
mutableAccumulator
- may be modified and returned for efficiencyinput
- should not be mutatedAccumT mergeAccumulators(AccumT mutableAccumulator, java.lang.Iterable<AccumT> immutableAccumulators)
mutableAccumulator
- This accumulator may be modified and returned for efficiency.immutableAccumulators
- These other accumulators should not be mutated, because they may
be shared with other code and mutating them could lead to incorrect results or data
corruption.