public class GrpcDataService extends org.apache.beam.model.fnexecution.v1.BeamFnDataGrpc.BeamFnDataImplBase implements FnService, FnDataService
FnDataService
implemented via gRPC.
This service allows for multiple clients to transmit BeamFnApi.Elements
messages.
This service transmits all outgoing BeamFnApi.Elements
messages to the first client
that connects.
Modifier and Type | Method and Description |
---|---|
void |
close()
.
|
static GrpcDataService |
create(java.util.concurrent.ExecutorService executor,
OutboundObserverFactory outboundObserverFactory) |
org.apache.beam.vendor.grpc.v1_13_1.io.grpc.stub.StreamObserver<org.apache.beam.model.fnexecution.v1.BeamFnApi.Elements> |
data(org.apache.beam.vendor.grpc.v1_13_1.io.grpc.stub.StreamObserver<org.apache.beam.model.fnexecution.v1.BeamFnApi.Elements> outboundElementObserver) |
<T> InboundDataClient |
receive(LogicalEndpoint inputLocation,
Coder<org.apache.beam.sdk.util.WindowedValue<T>> coder,
FnDataReceiver<org.apache.beam.sdk.util.WindowedValue<T>> listener)
Registers a receiver to be notified upon any incoming elements.
|
<T> CloseableFnDataReceiver<org.apache.beam.sdk.util.WindowedValue<T>> |
send(LogicalEndpoint outputLocation,
Coder<org.apache.beam.sdk.util.WindowedValue<T>> coder)
Creates a receiver to which you can write data values and have them sent over this data plane
service.
|
bindService
public static GrpcDataService create(java.util.concurrent.ExecutorService executor, OutboundObserverFactory outboundObserverFactory)
public org.apache.beam.vendor.grpc.v1_13_1.io.grpc.stub.StreamObserver<org.apache.beam.model.fnexecution.v1.BeamFnApi.Elements> data(org.apache.beam.vendor.grpc.v1_13_1.io.grpc.stub.StreamObserver<org.apache.beam.model.fnexecution.v1.BeamFnApi.Elements> outboundElementObserver)
data
in class org.apache.beam.model.fnexecution.v1.BeamFnDataGrpc.BeamFnDataImplBase
public void close() throws java.lang.Exception
FnService
There should be no more calls to any service method by the time a call to FnService.close()
begins. Specifically, this means that a Server
that this service is bound to should have
completed a call to the Server.shutdown()
method, and all future incoming calls will be rejected.
public <T> InboundDataClient receive(LogicalEndpoint inputLocation, Coder<org.apache.beam.sdk.util.WindowedValue<T>> coder, FnDataReceiver<org.apache.beam.sdk.util.WindowedValue<T>> listener)
FnDataService
The 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 put the InboundDataClient
into an error state such that InboundDataClient.awaitCompletion()
will throw an exception.
The provided receiver is not required to be thread safe.
receive
in interface FnDataService
public <T> CloseableFnDataReceiver<org.apache.beam.sdk.util.WindowedValue<T>> send(LogicalEndpoint outputLocation, Coder<org.apache.beam.sdk.util.WindowedValue<T>> coder)
FnDataService
The provided coder is used to encode elements on the outbound stream.
Closing the returned receiver signals the end of the stream.
The returned receiver is not thread safe.
send
in interface FnDataService