Package org.apache.beam.sdk.transforms
Class Combine.SimpleCombineFn<V>
java.lang.Object
org.apache.beam.sdk.transforms.Combine.CombineFn<V,List<V>,V>
org.apache.beam.sdk.transforms.Combine.IterableCombineFn<V>
org.apache.beam.sdk.transforms.Combine.SimpleCombineFn<V>
- All Implemented Interfaces:
Serializable
,CombineFnBase.GlobalCombineFn<V,
,List<V>, V> HasDisplayData
,org.apache.beam.sdk.util.NameUtils.NameOverride
- Enclosing class:
Combine
Deprecated.
Converts a
SerializableFunction
from Iterable<V>
s to V
s into a simple
Combine.CombineFn
over V
s.
@deprecated Use Combine.IterableCombineFn
or the more space efficient Combine.BinaryCombineFn
instead (which avoids buffering values).
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SimpleCombineFn
(SerializableFunction<Iterable<V>, V> combiner) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionTypeVariable
<?> Returns theTypeVariable
ofAccumT
.getAccumulatorCoder
(CoderRegistry registry, Coder<V> inputCoder) Returns theCoder
to use for accumulatorAccumT
values, or null if it is not able to be inferred.getDefaultOutputCoder
(CoderRegistry registry, Coder<V> inputCoder) Returns theCoder
to use by default for outputOutputT
values, or null if it is not able to be inferred.Returns the error message for not supported default values in Combine.globally().TypeVariable
<?> Returns theTypeVariable
ofInputT
.TypeVariable
<?> Returns theTypeVariable
ofOutputT
.static <V> Combine.SimpleCombineFn
<V> of
(SerializableFunction<Iterable<V>, V> combiner) Deprecated.Returns aCombineFn
that uses the givenSerializableFunction
to combine values.Methods inherited from class org.apache.beam.sdk.transforms.Combine.IterableCombineFn
addInput, compact, createAccumulator, extractOutput, getNameOverride, mergeAccumulators, of, populateDisplayData
Methods inherited from class org.apache.beam.sdk.transforms.Combine.CombineFn
apply, defaultValue, getInputType, getOutputType
-
Constructor Details
-
SimpleCombineFn
Deprecated.
-
-
Method Details
-
of
Deprecated.Returns aCombineFn
that uses the givenSerializableFunction
to combine values. -
getAccumulatorCoder
public Coder<List<V>> getAccumulatorCoder(CoderRegistry registry, Coder<V> inputCoder) throws CannotProvideCoderException Description copied from interface:CombineFnBase.GlobalCombineFn
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.
- Specified by:
getAccumulatorCoder
in interfaceCombineFnBase.GlobalCombineFn<InputT,
AccumT, OutputT> - Throws:
CannotProvideCoderException
-
getDefaultOutputCoder
public Coder<V> getDefaultOutputCoder(CoderRegistry registry, Coder<V> inputCoder) throws CannotProvideCoderException Description copied from interface:CombineFnBase.GlobalCombineFn
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.- Specified by:
getDefaultOutputCoder
in interfaceCombineFnBase.GlobalCombineFn<InputT,
AccumT, OutputT> - Throws:
CannotProvideCoderException
-
getIncompatibleGlobalWindowErrorMessage
Description copied from interface:CombineFnBase.GlobalCombineFn
Returns the error message for not supported default values in Combine.globally().- Specified by:
getIncompatibleGlobalWindowErrorMessage
in interfaceCombineFnBase.GlobalCombineFn<InputT,
AccumT, OutputT>
-
getInputTVariable
Returns theTypeVariable
ofInputT
. -
getAccumTVariable
Returns theTypeVariable
ofAccumT
. -
getOutputTVariable
Returns theTypeVariable
ofOutputT
.
-