Class BeamFnControlClient
- java.lang.Object
-
- org.apache.beam.fn.harness.control.BeamFnControlClient
-
public class BeamFnControlClient extends java.lang.ObjectA client for the Beam Fn Control API. Uses an unbounded internal queue to pull down an unbounded number of requests.Also can delegate to a set of handlers based upon the
request type.When the inbound instruction stream finishes successfully, the
onFinishis completed successfully signaling to the caller that this client will not produce any moreBeamFnApi.InstructionRequests. If the inbound instruction stream errors, theonFinishis completed exceptionally propagating the failure reason to the caller and signaling that this client will not produce any moreBeamFnApi.InstructionRequests.
-
-
Constructor Summary
Constructors Constructor Description BeamFnControlClient(org.apache.beam.model.fnexecution.v1.BeamFnControlGrpc.BeamFnControlStub controlStub, org.apache.beam.sdk.fn.stream.OutboundObserverFactory outboundObserverFactory, java.util.concurrent.Executor executor, java.util.EnumMap<org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionRequest.RequestCase,org.apache.beam.sdk.function.ThrowingFunction<org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionRequest,org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionResponse.Builder>> handlers)BeamFnControlClient(org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor apiServiceDescriptor, org.apache.beam.sdk.fn.channel.ManagedChannelFactory channelFactory, org.apache.beam.sdk.fn.stream.OutboundObserverFactory outboundObserverFactory, java.util.concurrent.Executor executor, java.util.EnumMap<org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionRequest.RequestCase,org.apache.beam.sdk.function.ThrowingFunction<org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionRequest,org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionResponse.Builder>> handlers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionResponsedelegateOnInstructionRequestType(org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionRequest value)voidsendInstructionResponse(org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionResponse value)java.util.concurrent.CompletableFuture<java.lang.Object>terminationFuture()This method blocks until the control stream has completed.
-
-
-
Constructor Detail
-
BeamFnControlClient
public BeamFnControlClient(org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor apiServiceDescriptor, org.apache.beam.sdk.fn.channel.ManagedChannelFactory channelFactory, org.apache.beam.sdk.fn.stream.OutboundObserverFactory outboundObserverFactory, java.util.concurrent.Executor executor, java.util.EnumMap<org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionRequest.RequestCase,org.apache.beam.sdk.function.ThrowingFunction<org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionRequest,org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionResponse.Builder>> handlers)
-
BeamFnControlClient
public BeamFnControlClient(org.apache.beam.model.fnexecution.v1.BeamFnControlGrpc.BeamFnControlStub controlStub, org.apache.beam.sdk.fn.stream.OutboundObserverFactory outboundObserverFactory, java.util.concurrent.Executor executor, java.util.EnumMap<org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionRequest.RequestCase,org.apache.beam.sdk.function.ThrowingFunction<org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionRequest,org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionResponse.Builder>> handlers)
-
-
Method Detail
-
terminationFuture
public java.util.concurrent.CompletableFuture<java.lang.Object> terminationFuture()
This method blocks until the control stream has completed.
-
delegateOnInstructionRequestType
public org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionResponse delegateOnInstructionRequestType(org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionRequest value)
-
sendInstructionResponse
public void sendInstructionResponse(org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionResponse value)
-
-