Google Cloud Dataflow SDK for Java, version 1.9.1
Class Sum.SumIntegerFn
- java.lang.Object
-
- com.google.cloud.dataflow.sdk.transforms.Combine.CombineFn<Integer,int[],Integer>
-
- com.google.cloud.dataflow.sdk.transforms.Combine.BinaryCombineIntegerFn
-
- com.google.cloud.dataflow.sdk.transforms.Sum.SumIntegerFn
-
- All Implemented Interfaces:
- CombineFnBase.GlobalCombineFn<Integer,int[],Integer>, HasDisplayData, com.google.cloud.dataflow.sdk.util.common.CounterProvider<Integer>, Serializable
- Enclosing class:
- Sum
public static class Sum.SumIntegerFn extends Combine.BinaryCombineIntegerFn implements com.google.cloud.dataflow.sdk.util.common.CounterProvider<Integer>
ASerializableFunction
that computes the sum of anIterable
ofInteger
s, useful as an argument toCombine.globally(com.google.cloud.dataflow.sdk.transforms.SerializableFunction<java.lang.Iterable<V>, V>)
orCombine.perKey(com.google.cloud.dataflow.sdk.transforms.SerializableFunction<java.lang.Iterable<V>, V>)
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description SumIntegerFn()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description int
apply(int a, int b)
Applies the binary operation to the two operands, returning the result.TypeVariable<?>
getAccumTVariable()
Returns theTypeVariable
ofAccumT
.com.google.cloud.dataflow.sdk.util.common.Counter<Integer>
getCounter(String name)
String
getIncompatibleGlobalWindowErrorMessage()
Returns the error message for not supported default values in Combine.globally().TypeVariable<?>
getInputTVariable()
Returns theTypeVariable
ofInputT
.TypeVariable<?>
getOutputTVariable()
Returns theTypeVariable
ofOutputT
.int
identity()
Returns the identity element of this operation, i.e.void
populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.-
Methods inherited from class com.google.cloud.dataflow.sdk.transforms.Combine.BinaryCombineIntegerFn
addInput, createAccumulator, extractOutput, getAccumulatorCoder, getDefaultOutputCoder, mergeAccumulators
-
Methods inherited from class com.google.cloud.dataflow.sdk.transforms.Combine.CombineFn
apply, asKeyedFn, compact, defaultValue, getOutputType
-
-
-
-
Method Detail
-
apply
public int apply(int a, int b)
Description copied from class:Combine.BinaryCombineIntegerFn
Applies the binary operation to the two operands, returning the result.- Specified by:
apply
in classCombine.BinaryCombineIntegerFn
-
identity
public int identity()
Description copied from class:Combine.BinaryCombineIntegerFn
Returns the identity element of this operation, i.e. an elemente
such thatapply(e, x) == apply(x, e) == x
for all values ofx
.- Specified by:
identity
in classCombine.BinaryCombineIntegerFn
-
getCounter
public com.google.cloud.dataflow.sdk.util.common.Counter<Integer> getCounter(String name)
- Specified by:
getCounter
in interfacecom.google.cloud.dataflow.sdk.util.common.CounterProvider<Integer>
- Overrides:
getCounter
in classCombine.BinaryCombineIntegerFn
-
getIncompatibleGlobalWindowErrorMessage
public String 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
public TypeVariable<?> getInputTVariable()
Returns theTypeVariable
ofInputT
.
-
getAccumTVariable
public TypeVariable<?> getAccumTVariable()
Returns theTypeVariable
ofAccumT
.
-
getOutputTVariable
public TypeVariable<?> getOutputTVariable()
Returns theTypeVariable
ofOutputT
.
-
populateDisplayData
public void populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.populateDisplayData(DisplayData.Builder)
is invoked by Pipeline runners to collect display data viaDisplayData.from(HasDisplayData)
. Implementations may callsuper.populateDisplayData(builder)
in order to register display data in the current namespace, but should otherwise usesubcomponent.populateDisplayData(builder)
to use the namespace of the subcomponent.By default, does not register any display data. Implementors may override this method to provide their own display data.
- Specified by:
populateDisplayData
in interfaceHasDisplayData
- Parameters:
builder
- The builder to populate with display data.- See Also:
HasDisplayData
-
-