public class QueueingBeamFnDataClient extends java.lang.Object implements BeamFnDataClient
BeamFnDataClient that queues elements so that they can be consumed and processed in the
thread which calls @{link #drainAndBlock}.| Modifier and Type | Class and Description |
|---|---|
class |
QueueingBeamFnDataClient.QueueingFnDataReceiver<T>
The QueueingFnDataReceiver is a a FnDataReceiver used by the QueueingBeamFnDataClient.
|
| Constructor and Description |
|---|
QueueingBeamFnDataClient(BeamFnDataClient mainClient) |
| Modifier and Type | Method and Description |
|---|---|
void |
drainAndBlock()
Drains the internal queue of this class, by waiting for all WindowedValues to be passed to
their consumers.
|
<T> org.apache.beam.sdk.fn.data.InboundDataClient |
receive(org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor apiServiceDescriptor,
org.apache.beam.sdk.fn.data.LogicalEndpoint inputLocation,
org.apache.beam.sdk.coders.Coder<org.apache.beam.sdk.util.WindowedValue<T>> coder,
org.apache.beam.sdk.fn.data.FnDataReceiver<org.apache.beam.sdk.util.WindowedValue<T>> consumer)
Registers the following inbound receiver for the provided instruction id and target.
|
<T> org.apache.beam.sdk.fn.data.CloseableFnDataReceiver<org.apache.beam.sdk.util.WindowedValue<T>> |
send(org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor apiServiceDescriptor,
org.apache.beam.sdk.fn.data.LogicalEndpoint outputLocation,
org.apache.beam.sdk.coders.Coder<org.apache.beam.sdk.util.WindowedValue<T>> coder)
Creates a
CloseableFnDataReceiver using the provided instruction id and target. |
public QueueingBeamFnDataClient(BeamFnDataClient mainClient)
public <T> org.apache.beam.sdk.fn.data.InboundDataClient receive(org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor apiServiceDescriptor,
org.apache.beam.sdk.fn.data.LogicalEndpoint inputLocation,
org.apache.beam.sdk.coders.Coder<org.apache.beam.sdk.util.WindowedValue<T>> coder,
org.apache.beam.sdk.fn.data.FnDataReceiver<org.apache.beam.sdk.util.WindowedValue<T>> consumer)
BeamFnDataClientThe provided coder is used to decode inbound elements. The decoded elements are passed to the provided receiver. Any failure during decoding or processing of the element will complete the returned future exceptionally. On successful termination of the stream, the returned future is completed successfully.
The receiver is not required to be thread safe.
receive in interface BeamFnDataClientpublic void drainAndBlock()
throws java.lang.Exception
All InboundDataClients will be failed if processing throws an exception.
This method is NOT thread safe. This should only be invoked by a single thread, and is
intended for use with a newly constructed QueueingBeamFnDataClient in ProcessBundleHandler#processBundle(InstructionRequest).
java.lang.Exceptionpublic <T> org.apache.beam.sdk.fn.data.CloseableFnDataReceiver<org.apache.beam.sdk.util.WindowedValue<T>> send(org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor apiServiceDescriptor,
org.apache.beam.sdk.fn.data.LogicalEndpoint outputLocation,
org.apache.beam.sdk.coders.Coder<org.apache.beam.sdk.util.WindowedValue<T>> coder)
BeamFnDataClientCloseableFnDataReceiver using the provided instruction id and target.
The provided coder is used to encode elements on the outbound stream.
Closing the returned receiver signals the end of the stream.
The returned closeable receiver is not thread safe.
send in interface BeamFnDataClient