Class SdkHarnessClient
- java.lang.Object
-
- org.apache.beam.runners.fnexecution.control.SdkHarnessClient
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class SdkHarnessClient extends java.lang.Object implements java.lang.AutoCloseableA high-level client for an SDK harness.This provides a Java-friendly wrapper around
InstructionRequestHandlerandCloseableFnDataReceiver, which handle lower-level gRPC message wrangling.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classSdkHarnessClient.BundleProcessorA processor capable of creating bundles for some registeredBeamFnApi.ProcessBundleDescriptor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()InstructionRequestHandlergetInstructionRequestHandler()SdkHarnessClient.BundleProcessorgetProcessor(org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleDescriptor descriptor, java.util.List<RemoteInputDestination> remoteInputDesinations)ProvidesSdkHarnessClient.BundleProcessorthat is capable of processing bundles not containing timers or state accesses such as: Side inputs User state Remote referencesSdkHarnessClient.BundleProcessorgetProcessor(org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleDescriptor descriptor, java.util.List<RemoteInputDestination> remoteInputDesinations, StateDelegator stateDelegator)ProvidesSdkHarnessClient.BundleProcessorthat is capable of processing bundles not containing timers.SdkHarnessClient.BundleProcessorgetProcessor(org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleDescriptor descriptor, java.util.List<RemoteInputDestination> remoteInputDestinations, StateDelegator stateDelegator, java.util.Map<java.lang.String,java.util.Map<java.lang.String,ProcessBundleDescriptors.TimerSpec>> timerSpecs)ProvidesSdkHarnessClient.BundleProcessorthat is capable of processing bundles containing timers and state accesses such as: Side inputs User state Remote referencesstatic SdkHarnessClientusingFnApiClient(InstructionRequestHandler fnApiControlClient, FnDataService fnApiDataService)Creates a client for a particular SDK harness.SdkHarnessClientwithIdGenerator(org.apache.beam.sdk.fn.IdGenerator idGenerator)
-
-
-
Method Detail
-
getInstructionRequestHandler
public InstructionRequestHandler getInstructionRequestHandler()
-
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)
ProvidesSdkHarnessClient.BundleProcessorthat 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.
-
getProcessor
public SdkHarnessClient.BundleProcessor getProcessor(org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleDescriptor descriptor, java.util.List<RemoteInputDestination> remoteInputDesinations, StateDelegator stateDelegator)
ProvidesSdkHarnessClient.BundleProcessorthat is capable of processing bundles not containing timers.Note that bundle processors are cached based upon the
process bundle descriptor id. A previously created instance may be returned.
-
getProcessor
public SdkHarnessClient.BundleProcessor getProcessor(org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleDescriptor descriptor, java.util.List<RemoteInputDestination> remoteInputDestinations, StateDelegator stateDelegator, java.util.Map<java.lang.String,java.util.Map<java.lang.String,ProcessBundleDescriptors.TimerSpec>> timerSpecs)
ProvidesSdkHarnessClient.BundleProcessorthat is capable of processing bundles containing timers and 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:
closein interfacejava.lang.AutoCloseable
-
-