public static class Sum.SumIntegerFn extends Combine.BinaryCombineIntegerFn implements org.apache.beam.sdk.util.common.CounterProvider<Integer>
SerializableFunction that computes the sum of an
Iterable of Integers, useful as an argument to
Combine.globally(org.apache.beam.sdk.transforms.SerializableFunction<java.lang.Iterable<V>, V>) or Combine.perKey(org.apache.beam.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. |
org.apache.beam.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.
|
void |
populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.
|
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 org.apache.beam.sdk.util.common.Counter<Integer> getCounter(String name)
getCounter in interface org.apache.beam.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.public void populateDisplayData(DisplayData.Builder builder)
populateDisplayData(DisplayData.Builder) is invoked by Pipeline runners to collect
display data via DisplayData.from(HasDisplayData). Implementations may call
super.populateDisplayData(builder) in order to register display data in the current
namespace, but should otherwise use subcomponent.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.
populateDisplayData in interface HasDisplayDatabuilder - The builder to populate with display data.HasDisplayData