Interface AdaptiveExecutionHandler
- All Known Implementing Classes:
DefaultAdaptiveExecutionHandler,NonAdaptiveExecutionHandler
public interface AdaptiveExecutionHandler
The
AdaptiveExecutionHandler interface defines the operations for handling the adaptive
execution of batch jobs. This includes acquiring the current job graph and dynamically adjusting
the job topology in response to job events.-
Method Summary
Modifier and TypeMethodDescriptioncreateExecutionPlanSchedulingContext(int defaultMaxParallelism) Creates an instance ofExecutionPlanSchedulingContext.intgetInitialParallelism(JobVertexID jobVertexId) Retrieves the initial parallelism for a given JobVertex ID.Returns theJobGraphrepresenting the batch job.voidhandleJobEvent(JobEvent jobEvent) Handles the providedJobEvent, attempting dynamic modifications to theStreamGraphbased on the specifics of the job event.voidnotifyJobVertexParallelismDecided(JobVertexID jobVertexId, int parallelism) Notifies the handler that the parallelism of a JobVertex has been decided.voidRegisters a listener to receive updates when theJobGraphis modified.
-
Method Details
-
getJobGraph
JobGraph getJobGraph()Returns theJobGraphrepresenting the batch job.- Returns:
- the JobGraph.
-
handleJobEvent
Handles the providedJobEvent, attempting dynamic modifications to theStreamGraphbased on the specifics of the job event.- Parameters:
jobEvent- The job event to handle. This event contains the necessary information that might trigger adjustments to the StreamGraph.
-
registerJobGraphUpdateListener
Registers a listener to receive updates when theJobGraphis modified.- Parameters:
listener- the listener to register for JobGraph updates.
-
getInitialParallelism
Retrieves the initial parallelism for a given JobVertex ID.- Parameters:
jobVertexId- the JobVertex ID.- Returns:
- the corresponding initial parallelism.
-
notifyJobVertexParallelismDecided
Notifies the handler that the parallelism of a JobVertex has been decided.- Parameters:
jobVertexId- the identifier of the JobVertex whose parallelism was decided.parallelism- the decided parallelism of the JobVertex.
-
createExecutionPlanSchedulingContext
Creates an instance ofExecutionPlanSchedulingContext.- Parameters:
defaultMaxParallelism- the default value for maximum parallelism.- Returns:
- an instance of
ExecutionPlanSchedulingContext.
-