Interface BeamFnDataClient
-
- All Known Implementing Classes:
BeamFnDataGrpcClient
public interface BeamFnDataClientTheBeamFnDataClientis able to forward inbound elements to aFnDataReceiverand provide a receiver of outbound elements. Callers can register themselves as receivers for inbound elements or can get a handle for a receiver of outbound elements.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.apache.beam.vendor.grpc.v1p69p0.io.grpc.stub.StreamObserver<org.apache.beam.model.fnexecution.v1.BeamFnApi.Elements>getOutboundObserver(org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor apiServiceDescriptor, java.lang.String dataStreamId)Get the outbound observer for the specified apiServiceDescriptor and dataStreamId.voidpoisonInstructionId(java.lang.String instructionId)Poisons the instruction id, indicating that future data arriving for it should be discarded.voidregisterReceiver(java.lang.String instructionId, java.lang.String dataStreamId, java.util.List<org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor> apiServiceDescriptors, org.apache.beam.sdk.fn.data.CloseableFnDataReceiver<org.apache.beam.model.fnexecution.v1.BeamFnApi.Elements> receiver)Registers a receiver for the provided instruction id.voidunregisterReceiver(java.lang.String instructionId, java.lang.String dataStreamId, java.util.List<org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor> apiServiceDescriptors)Receivers are only expected to be unregistered when bundle processing has completed successfully.
-
-
-
Method Detail
-
registerReceiver
void registerReceiver(java.lang.String instructionId, java.lang.String dataStreamId, java.util.List<org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor> apiServiceDescriptors, org.apache.beam.sdk.fn.data.CloseableFnDataReceiver<org.apache.beam.model.fnexecution.v1.BeamFnApi.Elements> receiver)Registers 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
unregisterReceiver(java.lang.String, java.lang.String, java.util.List<org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor>)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 theBeamFnDataClientduring a futureFnDataReceiver.accept(T)invocation.
-
unregisterReceiver
void unregisterReceiver(java.lang.String instructionId, java.lang.String dataStreamId, java.util.List<org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor> apiServiceDescriptors)Receivers 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
BeamFnDataClientduring a futureFnDataReceiver.accept(T)invocation or via a call topoisonInstructionId(java.lang.String).
-
poisonInstructionId
void poisonInstructionId(java.lang.String instructionId)
Poisons the instruction id, indicating that future data arriving for it should be discarded. Unregisters the receiver if was registered.- Parameters:
instructionId-
-
getOutboundObserver
org.apache.beam.vendor.grpc.v1p69p0.io.grpc.stub.StreamObserver<org.apache.beam.model.fnexecution.v1.BeamFnApi.Elements> getOutboundObserver(org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor apiServiceDescriptor, java.lang.String dataStreamId)Get the outbound observer for the specified apiServiceDescriptor and dataStreamId.
-
-