Class SdkHarnessClient

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class SdkHarnessClient
    extends java.lang.Object
    implements java.lang.AutoCloseable
    A high-level client for an SDK harness.

    This provides a Java-friendly wrapper around InstructionRequestHandler and CloseableFnDataReceiver, which handle lower-level gRPC message wrangling.

    • Method Detail

      • usingFnApiClient

        public static SdkHarnessClient usingFnApiClient​(InstructionRequestHandler fnApiControlClient,
                                                        FnDataService fnApiDataService)
        Creates a client for a particular SDK harness. It is the responsibility of the caller to ensure that these correspond to the same SDK harness, so control plane and data plane messages can be correctly associated.
      • withIdGenerator

        public SdkHarnessClient withIdGenerator​(org.apache.beam.sdk.fn.IdGenerator idGenerator)
      • getProcessor

        public SdkHarnessClient.BundleProcessor getProcessor​(org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleDescriptor descriptor,
                                                             java.util.List<RemoteInputDestination> remoteInputDesinations)
        Provides SdkHarnessClient.BundleProcessor that is capable of processing bundles not containing timers or state accesses such as:
        • Side inputs
        • User state
        • Remote references

        Note that bundle processors are cached based upon the process bundle descriptor id. A previously created instance may be returned.

      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable