Google Cloud Dataflow SDK for Java, version 1.9.1
Interface CombineFnBase.GlobalCombineFn<InputT,AccumT,OutputT>
-
- Type Parameters:
InputT
- type of input valuesAccumT
- type of mutable accumulator valuesOutputT
- type of output values
- All Superinterfaces:
- HasDisplayData, Serializable
- All Known Implementing Classes:
- ApproximateQuantiles.ApproximateQuantilesCombineFn, ApproximateUnique.ApproximateUniqueCombineFn, Combine.AccumulatingCombineFn, Combine.BinaryCombineDoubleFn, Combine.BinaryCombineFn, Combine.BinaryCombineIntegerFn, Combine.BinaryCombineLongFn, Combine.CombineFn, Combine.IterableCombineFn, Combine.SimpleCombineFn, CombineFns.ComposedCombineFn, CombineFns.ComposedCombineFnWithContext, CombineWithContext.CombineFnWithContext, Max.MaxDoubleFn, Max.MaxFn, Max.MaxIntegerFn, Max.MaxLongFn, Min.MinDoubleFn, Min.MinFn, Min.MinIntegerFn, Min.MinLongFn, Sample.FixedSizedSampleFn, Sum.SumDoubleFn, Sum.SumIntegerFn, Sum.SumLongFn, Top.TopCombineFn
- Enclosing class:
- CombineFnBase
public static interface CombineFnBase.GlobalCombineFn<InputT,AccumT,OutputT> extends Serializable, HasDisplayData
AGloballyCombineFn<InputT, AccumT, OutputT>
specifies how to combine a collection of input values of typeInputT
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.CombineFn
andCombineWithContext.CombineFnWithContext
instead.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description <K> CombineFnBase.PerKeyCombineFn<K,InputT,AccumT,OutputT>
asKeyedFn()
Converts thisGloballyCombineFn
into an equivalentCombineFnBase.PerKeyCombineFn
that ignores the keys passed to it and combines the values according to thisGloballyCombineFn
.OutputT
defaultValue()
Returns the default value when there are no values added to the accumulator.Coder<AccumT>
getAccumulatorCoder(CoderRegistry registry, 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<InputT> inputCoder)
Returns theCoder
to use by default for outputOutputT
values, or null if it is not able to be inferred.String
getIncompatibleGlobalWindowErrorMessage()
Returns the error message for not supported default values in Combine.globally().-
Methods inherited from interface com.google.cloud.dataflow.sdk.transforms.display.HasDisplayData
populateDisplayData
-
-
-
-
Method Detail
-
getAccumulatorCoder
Coder<AccumT> getAccumulatorCoder(CoderRegistry registry, 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 forInputT
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<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 for inputInputT
values and the enclosingPipeline
'sCoderRegistry
to try to infer the Coder forOutputT
values.- Throws:
CannotProvideCoderException
-
getIncompatibleGlobalWindowErrorMessage
String getIncompatibleGlobalWindowErrorMessage()
Returns the error message for not supported default values in Combine.globally().
-
defaultValue
OutputT defaultValue()
Returns the default value when there are no values added to the accumulator.
-
asKeyedFn
<K> CombineFnBase.PerKeyCombineFn<K,InputT,AccumT,OutputT> asKeyedFn()
Converts thisGloballyCombineFn
into an equivalentCombineFnBase.PerKeyCombineFn
that ignores the keys passed to it and combines the values according to thisGloballyCombineFn
.- Type Parameters:
K
- the type of the (ignored) keys
-
-