Google Cloud Dataflow SDK for Java, version 1.9.1
Class Sum.SumDoubleFn
- java.lang.Object
-
- com.google.cloud.dataflow.sdk.transforms.Combine.CombineFn<Double,double[],Double>
-
- com.google.cloud.dataflow.sdk.transforms.Combine.BinaryCombineDoubleFn
-
- com.google.cloud.dataflow.sdk.transforms.Sum.SumDoubleFn
-
- All Implemented Interfaces:
- CombineFnBase.GlobalCombineFn<Double,double[],Double>, HasDisplayData, com.google.cloud.dataflow.sdk.util.common.CounterProvider<Double>, Serializable
- Enclosing class:
- Sum
public static class Sum.SumDoubleFn extends Combine.BinaryCombineDoubleFn implements com.google.cloud.dataflow.sdk.util.common.CounterProvider<Double>
ASerializableFunction
that computes the sum of anIterable
ofDouble
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 SumDoubleFn()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description double
apply(double a, double 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<Double>
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
.double
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.BinaryCombineDoubleFn
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 double apply(double a, double b)
Description copied from class:Combine.BinaryCombineDoubleFn
Applies the binary operation to the two operands, returning the result.- Specified by:
apply
in classCombine.BinaryCombineDoubleFn
-
identity
public double identity()
Description copied from class:Combine.BinaryCombineDoubleFn
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.BinaryCombineDoubleFn
-
getCounter
public com.google.cloud.dataflow.sdk.util.common.Counter<Double> getCounter(String name)
- Specified by:
getCounter
in interfacecom.google.cloud.dataflow.sdk.util.common.CounterProvider<Double>
- Overrides:
getCounter
in classCombine.BinaryCombineDoubleFn
-
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
-
-