T - type of element being comparedpublic static class Top.TopCombineFn<T> extends Combine.AccumulatingCombineFn<T,com.google.cloud.dataflow.sdk.transforms.Top.TopCombineFn.Heap,java.util.List<T>>
CombineFn for Top transforms that combines a
bunch of Ts into a single count-long
List<T>, using compareFn to choose the largest
Ts.Combine.AccumulatingCombineFn.Accumulator<VI,VA,VO>| Constructor and Description |
|---|
Top.TopCombineFn(int count,
C compareFn) |
| Modifier and Type | Method and Description |
|---|---|
com.google.cloud.dataflow.sdk.transforms.Top.TopCombineFn.Heap |
createAccumulator()
Returns a new, mutable accumulator value, representing the
accumulation of zero input values.
|
Coder<com.google.cloud.dataflow.sdk.transforms.Top.TopCombineFn.Heap> |
getAccumulatorCoder(CoderRegistry registry,
Coder<T> inputCoder)
Returns the
Coder to use for accumulator VA
values, or null if it is not able to be inferred. |
addInput, extractOutput, mergeAccumulatorsapply, asKeyedFn, getDefaultOutputCoderpublic com.google.cloud.dataflow.sdk.transforms.Top.TopCombineFn.Heap createAccumulator()
Combine.CombineFncreateAccumulator in class Combine.CombineFn<T,com.google.cloud.dataflow.sdk.transforms.Top.TopCombineFn.Heap,java.util.List<T>>public Coder<com.google.cloud.dataflow.sdk.transforms.Top.TopCombineFn.Heap> getAccumulatorCoder(CoderRegistry registry, Coder<T> inputCoder)
Combine.CombineFnCoder to use for accumulator VA
values, or null if it is not able to be inferred.
By default, uses the knowledge of the Coder being used
for VI values and the enclosing Pipeline's
CoderRegistry to try to infer the Coder for VA
values.
This is the Coder used to send data through a communication-intensive shuffle step, so a compact and efficient representation may have significant performance benefits.
getAccumulatorCoder in class Combine.CombineFn<T,com.google.cloud.dataflow.sdk.transforms.Top.TopCombineFn.Heap,java.util.List<T>>