public class BeamFnDataGrpcClient extends java.lang.Object implements BeamFnDataClient
BeamFnDataClient that uses gRPC for sending and receiving data.
TODO: Handle closing clients that are currently not a consumer nor are being consumed.
| Constructor and Description |
|---|
BeamFnDataGrpcClient(org.apache.beam.sdk.options.PipelineOptions options,
java.util.function.Function<org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor,org.apache.beam.vendor.grpc.v1p13p1.io.grpc.ManagedChannel> channelFactory,
org.apache.beam.sdk.fn.stream.OutboundObserverFactory outboundObserverFactory) |
| Modifier and Type | Method and Description |
|---|---|
<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 stream consumer 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 closeable consumer using the provided instruction id and target.
|
public BeamFnDataGrpcClient(org.apache.beam.sdk.options.PipelineOptions options,
java.util.function.Function<org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor,org.apache.beam.vendor.grpc.v1p13p1.io.grpc.ManagedChannel> channelFactory,
org.apache.beam.sdk.fn.stream.OutboundObserverFactory outboundObserverFactory)
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)
The provided coder is used to decode elements on the inbound stream. The decoded elements are passed to the provided consumer. Any failure during decoding or processing of the element will complete the returned future exceptionally. On successful termination of the stream (signaled by an empty data block), the returned future is completed successfully.
receive in interface BeamFnDataClientpublic <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)
The provided coder is used to encode elements on the outbound stream.
On closing the returned consumer, an empty data block is sent as a signal of the logical data stream finishing.
The returned closeable consumer is not thread safe.
send in interface BeamFnDataClient