Class GrpcDataService
- All Implemented Interfaces:
AutoCloseable,org.apache.beam.model.fnexecution.v1.BeamFnDataGrpc.AsyncService,FnDataService,FnService,org.apache.beam.vendor.grpc.v1p69p0.io.grpc.BindableService
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.
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.This constructor is for migrating Dataflow purpose only. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose().static GrpcDataServicecreate(PipelineOptions options, ExecutorService executor, OutboundObserverFactory outboundObserverFactory) createOutboundAggregator(Supplier<String> processBundleRequestIdSupplier, boolean collectElementsIfNoFlushes) Creates aBeamFnDataOutboundAggregatorfor buffering and sending outbound data and timers over the data plane.org.apache.beam.vendor.grpc.v1p69p0.io.grpc.stub.StreamObserver<org.apache.beam.model.fnexecution.v1.BeamFnApi.Elements> data(org.apache.beam.vendor.grpc.v1p69p0.io.grpc.stub.StreamObserver<org.apache.beam.model.fnexecution.v1.BeamFnApi.Elements> outboundElementObserver) voidregisterReceiver(String instructionId, CloseableFnDataReceiver<org.apache.beam.model.fnexecution.v1.BeamFnApi.Elements> observer) Registers a receiver for the provided instruction id.voidunregisterReceiver(String instructionId) Receivers are only expected to be unregistered when bundle processing has completed successfully.Methods inherited from class org.apache.beam.model.fnexecution.v1.BeamFnDataGrpc.BeamFnDataImplBase
bindServiceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.beam.vendor.grpc.v1p69p0.io.grpc.BindableService
bindService
-
Constructor Details
-
GrpcDataService
Deprecated.This constructor is for migrating Dataflow purpose only.
-
-
Method Details
-
create
public static GrpcDataService create(PipelineOptions options, ExecutorService executor, OutboundObserverFactory outboundObserverFactory) -
data
public org.apache.beam.vendor.grpc.v1p69p0.io.grpc.stub.StreamObserver<org.apache.beam.model.fnexecution.v1.BeamFnApi.Elements> data(org.apache.beam.vendor.grpc.v1p69p0.io.grpc.stub.StreamObserver<org.apache.beam.model.fnexecution.v1.BeamFnApi.Elements> outboundElementObserver) - Specified by:
datain interfaceorg.apache.beam.model.fnexecution.v1.BeamFnDataGrpc.AsyncService
-
close
Description copied from interface:FnService.There should be no more calls to any service method by the time a call to
FnService.close()begins. Specifically, this means that aServerthat this service is bound to should have completed a call to theServer.shutdown()method, and all future incoming calls will be rejected.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceFnService- Throws:
Exception
-
registerReceiver
public void registerReceiver(String instructionId, CloseableFnDataReceiver<org.apache.beam.model.fnexecution.v1.BeamFnApi.Elements> observer) Description copied from interface:FnDataServiceRegisters a receiver for the provided instruction id.The receiver is not required to be thread safe.
Receivers for successfully processed bundles must be unregistered. See
FnDataService.unregisterReceiver(java.lang.String)for details.Any failure during
FnDataReceiver.accept(T)will mark the providedinstructionIdas invalid and will ignore any future data. It is expected that if a bundle fails during processing then the failure will become visible to theFnDataServiceduring a futureFnDataReceiver.accept(T)invocation.- Specified by:
registerReceiverin interfaceFnDataService
-
unregisterReceiver
Description copied from interface:FnDataServiceReceivers are only expected to be unregistered when bundle processing has completed successfully.It is expected that if a bundle fails during processing then the failure will become visible to the
FnDataServiceduring a futureFnDataReceiver.accept(T)invocation.- Specified by:
unregisterReceiverin interfaceFnDataService
-
createOutboundAggregator
public BeamFnDataOutboundAggregator createOutboundAggregator(Supplier<String> processBundleRequestIdSupplier, boolean collectElementsIfNoFlushes) Description copied from interface:FnDataServiceCreates aBeamFnDataOutboundAggregatorfor buffering and sending outbound data and timers over the data plane. It is important thatBeamFnDataOutboundAggregator.sendOrCollectBufferedDataAndFinishOutboundStreams()is called on the returned BeamFnDataOutboundAggregator at the end of each bundle. If collectElementsIfNoFlushes is set to true,BeamFnDataOutboundAggregator.sendOrCollectBufferedDataAndFinishOutboundStreams()returns the buffered elements instead of sending it through the outbound StreamObserver if there's no previous flush.Closing the returned aggregator signals the end of the streams.
The returned aggregator is not thread safe.
- Specified by:
createOutboundAggregatorin interfaceFnDataService
-