T - the type of the values being comparedpublic static class Max.MaxFn<T> extends Combine.BinaryCombineFn<T>
CombineFn that computes the maximum of a collection of elements of type T
using an arbitrary Comparator, 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>).| Modifier and Type | Method and Description |
|---|---|
T |
apply(T left,
T right)
Applies the binary operation to the two operands, returning the result.
|
TypeVariable<?> |
getAccumTVariable()
Returns the
TypeVariable of AccumT. |
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. |
T |
identity()
Returns the value that should be used for the combine of the empty set.
|
static <T extends Comparable<? super T>> |
naturalOrder() |
static <T extends Comparable<? super T>> |
naturalOrder(T identity) |
static <T,ComparatorT extends Comparator<? super T> & Serializable> |
of(ComparatorT comparator) |
static <T,ComparatorT extends Comparator<? super T> & Serializable> |
of(T identity,
ComparatorT comparator) |
void |
populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.
|
addInput, createAccumulator, extractOutput, getAccumulatorCoder, getDefaultOutputCoder, mergeAccumulatorsapply, asKeyedFn, compact, defaultValue, getOutputTypepublic static <T,ComparatorT extends Comparator<? super T> & Serializable> Max.MaxFn<T> of(T identity, ComparatorT comparator)
public static <T,ComparatorT extends Comparator<? super T> & Serializable> Max.MaxFn<T> of(ComparatorT comparator)
public static <T extends Comparable<? super T>> Max.MaxFn<T> naturalOrder(T identity)
public static <T extends Comparable<? super T>> Max.MaxFn<T> naturalOrder()
public T identity()
Combine.BinaryCombineFnidentity in class Combine.BinaryCombineFn<T>public T apply(T left, T right)
Combine.BinaryCombineFnapply in class Combine.BinaryCombineFn<T>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.HasDisplayDatapublic 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.