public static class Sum.SumLongFn extends Combine.BinaryCombineLongFn
SerializableFunction that computes the sum of an
Iterable of Longs, 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 |
|---|
SumLongFn() |
| Modifier and Type | Method and Description |
|---|---|
long |
apply(long a,
long b)
Applies the binary operation to the two operands, returning the result.
|
com.google.cloud.dataflow.sdk.util.common.Counter<Long> |
getCounter(String name) |
long |
identity()
Returns the identity element of this operation, i.e.
|
addInput, createAccumulator, extractOutput, getAccumulatorCoder, getDefaultOutputCoder, mergeAccumulatorsapply, asKeyedFn, getOutputTypepublic long apply(long a,
long b)
Combine.BinaryCombineLongFnapply in class Combine.BinaryCombineLongFnpublic long identity()
Combine.BinaryCombineLongFne
such that apply(e, x) == apply(x, e) == x for all values of x.identity in class Combine.BinaryCombineLongFn