Class ExecutionStateSampler.ExecutionStateTracker
- java.lang.Object
-
- org.apache.beam.fn.harness.control.ExecutionStateSampler.ExecutionStateTracker
-
- All Implemented Interfaces:
BundleProgressReporter
- Enclosing class:
- ExecutionStateSampler
public class ExecutionStateSampler.ExecutionStateTracker extends java.lang.Object implements BundleProgressReporter
Tracks the current state of a single execution thread.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.beam.fn.harness.control.BundleProgressReporter
BundleProgressReporter.InMemory, BundleProgressReporter.Registrar
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExecutionStateSampler.ExecutionStatecreate(java.lang.String shortId, java.lang.String ptransformId, java.lang.String ptransformUniqueName, java.lang.String stateName)Returns anExecutionStateSampler.ExecutionStatebound to this tracker for the specified transform and processing state.@Nullable java.lang.StringgetCurrentThreadsPTransformId()Returns the ptransform id of the currently executing thread.org.apache.beam.sdk.metrics.MetricsContainergetMetricsContainer()Returns aMetricsContainerthat delegates based upon the current execution state to the appropriate metrics container that is bound to the currentExecutionStateSampler.ExecutionStateor to the unboundMetricsContainerif no execution state is currently running.org.apache.beam.runners.core.metrics.MetricsContainerStepMapgetMetricsContainerRegistry()Returns theMetricsContainerStepMapthat is managed by thisExecutionStateSampler.ExecutionStateTracker.@Nullable ExecutionStateSampler.ExecutionStateTrackerStatusgetStatus()Returns status information related to this tracker or null if not tracking a bundle.voidreset()Stops tracking execution states allowing for theExecutionStateSampler.ExecutionStateTrackerto be re-used for another bundle.voidstart(java.lang.String processBundleId)Starts tracking execution states for specifiedprocessBundleId.voidupdateFinalMonitoringData(java.util.Map<java.lang.String,org.apache.beam.vendor.grpc.v1p69p0.com.google.protobuf.ByteString> monitoringData)Update the monitoring data for a bundle that has finished processing.voidupdateIntermediateMonitoringData(java.util.Map<java.lang.String,org.apache.beam.vendor.grpc.v1p69p0.com.google.protobuf.ByteString> monitoringData)Update the monitoring data for a bundle that is currently being processed.
-
-
-
Method Detail
-
getMetricsContainerRegistry
public org.apache.beam.runners.core.metrics.MetricsContainerStepMap getMetricsContainerRegistry()
Returns theMetricsContainerStepMapthat is managed by thisExecutionStateSampler.ExecutionStateTracker. This metrics container registry stores all the user counters associated for the current bundle execution.
-
getMetricsContainer
public org.apache.beam.sdk.metrics.MetricsContainer getMetricsContainer()
Returns aMetricsContainerthat delegates based upon the current execution state to the appropriate metrics container that is bound to the currentExecutionStateSampler.ExecutionStateor to the unboundMetricsContainerif no execution state is currently running.
-
create
public ExecutionStateSampler.ExecutionState create(java.lang.String shortId, java.lang.String ptransformId, java.lang.String ptransformUniqueName, java.lang.String stateName)
Returns anExecutionStateSampler.ExecutionStatebound to this tracker for the specified transform and processing state.
-
getStatus
public @Nullable ExecutionStateSampler.ExecutionStateTrackerStatus getStatus()
Returns status information related to this tracker or null if not tracking a bundle.
-
getCurrentThreadsPTransformId
public @Nullable java.lang.String getCurrentThreadsPTransformId()
Returns the ptransform id of the currently executing thread.
-
start
public void start(java.lang.String processBundleId)
Starts tracking execution states for specifiedprocessBundleId.Only invoked by the bundle processing thread.
-
updateIntermediateMonitoringData
public void updateIntermediateMonitoringData(java.util.Map<java.lang.String,org.apache.beam.vendor.grpc.v1p69p0.com.google.protobuf.ByteString> monitoringData)
Description copied from interface:BundleProgressReporterUpdate the monitoring data for a bundle that is currently being processed.Must be invoked while holding the
ProcessBundleHandler.BundleProcessor.getProgressRequestLock().- Specified by:
updateIntermediateMonitoringDatain interfaceBundleProgressReporter
-
updateFinalMonitoringData
public void updateFinalMonitoringData(java.util.Map<java.lang.String,org.apache.beam.vendor.grpc.v1p69p0.com.google.protobuf.ByteString> monitoringData)
Description copied from interface:BundleProgressReporterUpdate the monitoring data for a bundle that has finished processing.Must be invoked from the main bundle processing thread and while holding the
ProcessBundleHandler.BundleProcessor.getProgressRequestLock().- Specified by:
updateFinalMonitoringDatain interfaceBundleProgressReporter
-
reset
public void reset()
Stops tracking execution states allowing for theExecutionStateSampler.ExecutionStateTrackerto be re-used for another bundle.- Specified by:
resetin interfaceBundleProgressReporter
-
-