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(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>).| 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) |
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 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.