Google Cloud Dataflow SDK for Java, version 1.9.1
Interface CombineFnBase.PerKeyCombineFn<K,InputT,AccumT,OutputT>
-
- Type Parameters:
K
- type of keysInputT
- type of input valuesAccumT
- type of mutable accumulator valuesOutputT
- type of output values
- All Superinterfaces:
- HasDisplayData, Serializable
- All Known Implementing Classes:
- Combine.KeyedCombineFn, CombineFns.ComposedKeyedCombineFn, CombineFns.ComposedKeyedCombineFnWithContext, CombineWithContext.KeyedCombineFnWithContext
- Enclosing class:
- CombineFnBase
public static interface CombineFnBase.PerKeyCombineFn<K,InputT,AccumT,OutputT> extends Serializable, HasDisplayData
APerKeyCombineFn<K, InputT, AccumT, OutputT>
specifies how to combine a collection of input values of typeInputT
, associated with a key of typeK
, into a single output value of typeOutputT
. It does this via one or more intermediate mutable accumulator values of typeAccumT
.Do not implement this interface directly. Extends
Combine.KeyedCombineFn
andCombineWithContext.KeyedCombineFnWithContext
instead.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description CombineFnBase.GlobalCombineFn<InputT,AccumT,OutputT>
forKey(K key, Coder<K> keyCoder)
Returns the a regularCombineFnBase.GlobalCombineFn
that operates on a specific key.Coder<AccumT>
getAccumulatorCoder(CoderRegistry registry, Coder<K> keyCoder, Coder<InputT> inputCoder)
Returns theCoder
to use for accumulatorAccumT
values, or null if it is not able to be inferred.Coder<OutputT>
getDefaultOutputCoder(CoderRegistry registry, Coder<K> keyCoder, Coder<InputT> inputCoder)
Returns theCoder
to use by default for outputOutputT
values, or null if it is not able to be inferred.-
Methods inherited from interface com.google.cloud.dataflow.sdk.transforms.display.HasDisplayData
populateDisplayData
-
-
-
-
Method Detail
-
getAccumulatorCoder
Coder<AccumT> getAccumulatorCoder(CoderRegistry registry, Coder<K> keyCoder, Coder<InputT> inputCoder) throws CannotProvideCoderException
Returns theCoder
to use for accumulatorAccumT
values, or null if it is not able to be inferred.By default, uses the knowledge of the
Coder
being used forK
keys and inputInputT
values and the enclosingPipeline
'sCoderRegistry
to try to infer the Coder forAccumT
values.This is the Coder used to send data through a communication-intensive shuffle step, so a compact and efficient representation may have significant performance benefits.
- Throws:
CannotProvideCoderException
-
getDefaultOutputCoder
Coder<OutputT> getDefaultOutputCoder(CoderRegistry registry, Coder<K> keyCoder, Coder<InputT> inputCoder) throws CannotProvideCoderException
Returns theCoder
to use by default for outputOutputT
values, or null if it is not able to be inferred.By default, uses the knowledge of the
Coder
being used forK
keys and inputInputT
values and the enclosingPipeline
'sCoderRegistry
to try to infer the Coder forOutputT
values.- Throws:
CannotProvideCoderException
-
forKey
CombineFnBase.GlobalCombineFn<InputT,AccumT,OutputT> forKey(K key, Coder<K> keyCoder)
Returns the a regularCombineFnBase.GlobalCombineFn
that operates on a specific key.
-
-