Class BeamFnControlClient


  • public class BeamFnControlClient
    extends java.lang.Object
    A 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 onFinish is completed successfully signaling to the caller that this client will not produce any more BeamFnApi.InstructionRequests. If the inbound instruction stream errors, the onFinish is completed exceptionally propagating the failure reason to the caller and signaling that this client will not produce any more BeamFnApi.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.InstructionResponse delegateOnInstructionRequestType​(org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionRequest value)  
      void sendInstructionResponse​(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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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)