Class ProcessBundleHandler
- java.lang.Object
-
- org.apache.beam.fn.harness.control.ProcessBundleHandler
-
public class ProcessBundleHandler extends java.lang.ObjectProcessesBeamFnApi.ProcessBundleRequests andBeamFnApi.ProcessBundleSplitRequests.BeamFnApi.ProcessBundleSplitRequests use acacheto find/create aProcessBundleHandler.BundleProcessor. The creation of aProcessBundleHandler.BundleProcessoruses the associatedBeamFnApi.ProcessBundleDescriptordefinition; creating runners for eachRunnerApi.FunctionSpec; wiring them together based upon theinputandoutputmap definitions. TheProcessBundleHandler.BundleProcessorexecutes the DAG based graph by starting all runners in reverse topological order, and finishing all runners in forward topological order.BeamFnApi.ProcessBundleSplitRequests finds anactiveProcessBundleHandler.BundleProcessorassociated with a currently processingBeamFnApi.ProcessBundleRequestand uses it to perform a split request. See breaking the fusion barrier for further details.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProcessBundleHandler.BundleProcessorA container for the reusable information used to process a bundle.static classProcessBundleHandler.BundleProcessorCacheA cache forProcessBundleHandler.BundleProcessors.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringJAVA_SOURCE_URN
-
Constructor Summary
Constructors Constructor Description ProcessBundleHandler(org.apache.beam.sdk.options.PipelineOptions options, java.util.Set<java.lang.String> runnerCapabilities, java.util.function.Function<java.lang.String,org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleDescriptor> fnApiRegistry, BeamFnDataClient beamFnDataClient, BeamFnStateGrpcClientCache beamFnStateGrpcClientCache, FinalizeBundleHandler finalizeBundleHandler, org.apache.beam.runners.core.metrics.ShortIdMap shortIds, ExecutionStateSampler executionStateSampler, Cache<java.lang.Object,java.lang.Object> processWideCache, @Nullable DataSampler dataSampler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProcessBundleHandler.BundleProcessorCachegetBundleProcessorCache()org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionResponse.BuilderprocessBundle(org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionRequest request)Processes a bundle, running the start(), process(), and finish() functions.org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionResponse.Builderprogress(org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionRequest request)voidshutdown()Shutdown the bundles, running the tearDown() functions.org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionResponse.BuildertrySplit(org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionRequest request)Splits an active bundle.
-
-
-
Field Detail
-
JAVA_SOURCE_URN
public static final java.lang.String JAVA_SOURCE_URN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ProcessBundleHandler
public ProcessBundleHandler(org.apache.beam.sdk.options.PipelineOptions options, java.util.Set<java.lang.String> runnerCapabilities, java.util.function.Function<java.lang.String,org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleDescriptor> fnApiRegistry, BeamFnDataClient beamFnDataClient, BeamFnStateGrpcClientCache beamFnStateGrpcClientCache, FinalizeBundleHandler finalizeBundleHandler, org.apache.beam.runners.core.metrics.ShortIdMap shortIds, ExecutionStateSampler executionStateSampler, Cache<java.lang.Object,java.lang.Object> processWideCache, @Nullable DataSampler dataSampler)
-
-
Method Detail
-
processBundle
public org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionResponse.Builder processBundle(org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionRequest request) throws java.lang.ExceptionProcesses a bundle, running the start(), process(), and finish() functions. This function is required to be reentrant.- Throws:
java.lang.Exception
-
progress
public org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionResponse.Builder progress(org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionRequest request) throws java.lang.Exception- Throws:
java.lang.Exception
-
trySplit
public org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionResponse.Builder trySplit(org.apache.beam.model.fnexecution.v1.BeamFnApi.InstructionRequest request)
Splits an active bundle.
-
shutdown
public void shutdown() throws java.lang.ExceptionShutdown the bundles, running the tearDown() functions.- Throws:
java.lang.Exception
-
getBundleProcessorCache
public ProcessBundleHandler.BundleProcessorCache getBundleProcessorCache()
-
-