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