OutT - type of the output elementpublic interface FutureCollector<OutT>
DoFn and propagates the result future to downstream operators
only after finish() is invoked.| Modifier and Type | Method and Description |
|---|---|
void |
add(java.util.concurrent.CompletionStage<org.apache.beam.sdk.util.WindowedValue<OutT>> element)
Outputs the element to the collector.
|
void |
addAll(java.util.concurrent.CompletionStage<java.util.Collection<org.apache.beam.sdk.util.WindowedValue<OutT>>> elements)
Outputs a collection of elements to the collector.
|
void |
discard()
Discards the elements within the collector.
|
java.util.concurrent.CompletionStage<java.util.Collection<org.apache.beam.sdk.util.WindowedValue<OutT>>> |
finish()
Seals this
FutureCollector, returning a CompletionStage containing all of the
elements that were added to it. |
void |
prepare()
Prepares the
FutureCollector to accept output elements. |
void add(java.util.concurrent.CompletionStage<org.apache.beam.sdk.util.WindowedValue<OutT>> element)
element - to add to the collectorvoid addAll(java.util.concurrent.CompletionStage<java.util.Collection<org.apache.beam.sdk.util.WindowedValue<OutT>>> elements)
elements - to add to the collectorvoid discard()
add(CompletionStage).java.util.concurrent.CompletionStage<java.util.Collection<org.apache.beam.sdk.util.WindowedValue<OutT>>> finish()
FutureCollector, returning a CompletionStage containing all of the
elements that were added to it. The add(CompletionStage) method will throw an IllegalStateException if called after a call to finish.
The FutureCollector needs to be started again to collect newer batch of output.
void prepare()
FutureCollector to accept output elements. The add(CompletionStage) method will throw an IllegalStateException if called without
preparing the collector.