public static class Sum.SumIntegerFn extends Combine.BinaryCombineIntegerFn implements com.google.cloud.dataflow.sdk.util.common.CounterProvider<Integer>
SerializableFunction that computes the sum of an
Iterable of Integers, useful as an argument to
Combine.globally(com.google.cloud.dataflow.sdk.transforms.SerializableFunction<java.lang.Iterable<V>, V>) or Combine.perKey(com.google.cloud.dataflow.sdk.transforms.SerializableFunction<java.lang.Iterable<V>, V>).| Constructor and Description |
|---|
SumIntegerFn() |
| 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 the
TypeVariable of AccumT. |
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 the
TypeVariable of InputT. |
TypeVariable<?> |
getOutputTVariable()
Returns the
TypeVariable of OutputT. |
int |
identity()
Returns the identity element of this operation, i.e.
|
addInput, createAccumulator, extractOutput, getAccumulatorCoder, getDefaultOutputCoder, mergeAccumulatorsapply, asKeyedFn, compact, defaultValue, getOutputTypepublic int apply(int a,
int b)
Combine.BinaryCombineIntegerFnapply in class Combine.BinaryCombineIntegerFnpublic int identity()
Combine.BinaryCombineIntegerFne
such that apply(e, x) == apply(x, e) == x for all values of x.identity in class Combine.BinaryCombineIntegerFnpublic com.google.cloud.dataflow.sdk.util.common.Counter<Integer> getCounter(String name)
getCounter in interface com.google.cloud.dataflow.sdk.util.common.CounterProvider<Integer>getCounter in class Combine.BinaryCombineIntegerFnpublic String getIncompatibleGlobalWindowErrorMessage()
CombineFnBase.GlobalCombineFngetIncompatibleGlobalWindowErrorMessage in interface CombineFnBase.GlobalCombineFn<InputT,AccumT,OutputT>public TypeVariable<?> getInputTVariable()
TypeVariable of InputT.public TypeVariable<?> getAccumTVariable()
TypeVariable of AccumT.public TypeVariable<?> getOutputTVariable()
TypeVariable of OutputT.