public static class Sum.SumIntegerFn extends Combine.BinaryCombineIntegerFn
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.
|
com.google.cloud.dataflow.sdk.util.common.Counter<Integer> |
getCounter(String name) |
int |
identity()
Returns the identity element of this operation, i.e.
|
addInput, createAccumulator, extractOutput, getAccumulatorCoder, getDefaultOutputCoder, mergeAccumulatorsapply, asKeyedFn, 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.BinaryCombineIntegerFn