T - the type of elements to concatenate.public static class View.Concatenate<T> extends Combine.CombineFn<T,List<T>,List<T>>
Ts into a single List<T> containing
all inputs.
For internal use only by View.asList(), which views a tiny PCollection
that fits in memory as a single List. For a large PCollection this is
expected to crash!
| Constructor and Description |
|---|
Concatenate() |
| Modifier and Type | Method and Description |
|---|---|
List<T> |
addInput(List<T> accumulator,
T input)
Adds the given input value to the given accumulator, returning the
new accumulator value.
|
List<T> |
createAccumulator()
Returns a new, mutable accumulator value, representing the
accumulation of zero input values.
|
List<T> |
extractOutput(List<T> accumulator)
Returns the output value that is the result of combining all
the input values represented by the given accumulator.
|
Coder<List<T>> |
getAccumulatorCoder(CoderRegistry registry,
Coder<T> inputCoder)
Returns the
Coder to use for accumulator AccumT
values, or null if it is not able to be inferred. |
Coder<List<T>> |
getDefaultOutputCoder(CoderRegistry registry,
Coder<T> inputCoder)
Returns the
Coder to use by default for output
OutputT values, or null if it is not able to be inferred. |
List<T> |
mergeAccumulators(Iterable<List<T>> accumulators)
Returns an accumulator representing the accumulation of all the
input values accumulated in the merging accumulators.
|
apply, asKeyedFn, getOutputTypepublic List<T> createAccumulator()
Combine.CombineFncreateAccumulator in class Combine.CombineFn<T,List<T>,List<T>>public List<T> addInput(List<T> accumulator, T input)
Combine.CombineFnFor efficiency, the input accumulator may be modified and returned.
public List<T> mergeAccumulators(Iterable<List<T>> accumulators)
Combine.CombineFnMay modify any of the argument accumulators. May return a fresh accumulator, or may return one of the (modified) argument accumulators.
mergeAccumulators in class Combine.CombineFn<T,List<T>,List<T>>public List<T> extractOutput(List<T> accumulator)
Combine.CombineFnextractOutput in class Combine.CombineFn<T,List<T>,List<T>>public Coder<List<T>> getAccumulatorCoder(CoderRegistry registry, Coder<T> inputCoder)
Combine.CombineFnCoder to use for accumulator AccumT
values, or null if it is not able to be inferred.
By default, uses the knowledge of the Coder being used
for InputT values and the enclosing Pipeline's
CoderRegistry to try to infer the Coder for AccumT
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,List<T>,List<T>>public Coder<List<T>> getDefaultOutputCoder(CoderRegistry registry, Coder<T> inputCoder)
Combine.CombineFnCoder to use by default for output
OutputT values, or null if it is not able to be inferred.
By default, uses the knowledge of the Coder being
used for input InputT values and the enclosing
Pipeline's CoderRegistry to try to infer the
Coder for OutputT values.
getDefaultOutputCoder in class Combine.CombineFn<T,List<T>,List<T>>