Interface AdaptiveExecutionHandler
-
- All Known Implementing Classes:
DefaultAdaptiveExecutionHandler
,NonAdaptiveExecutionHandler
public interface AdaptiveExecutionHandler
TheAdaptiveExecutionHandler
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExecutionPlanSchedulingContext
createExecutionPlanSchedulingContext(int defaultMaxParallelism)
Creates an instance ofExecutionPlanSchedulingContext
.int
getInitialParallelism(JobVertexID jobVertexId)
Retrieves the initial parallelism for a given JobVertex ID.JobGraph
getJobGraph()
Returns theJobGraph
representing the batch job.void
handleJobEvent(JobEvent jobEvent)
Handles the providedJobEvent
, attempting dynamic modifications to theStreamGraph
based on the specifics of the job event.void
notifyJobVertexParallelismDecided(JobVertexID jobVertexId, int parallelism)
Notifies the handler that the parallelism of a JobVertex has been decided.void
registerJobGraphUpdateListener(JobGraphUpdateListener listener)
Registers a listener to receive updates when theJobGraph
is modified.
-
-
-
Method Detail
-
getJobGraph
JobGraph getJobGraph()
Returns theJobGraph
representing the batch job.- Returns:
- the JobGraph.
-
handleJobEvent
void handleJobEvent(JobEvent jobEvent)
Handles the providedJobEvent
, attempting dynamic modifications to theStreamGraph
based 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
void registerJobGraphUpdateListener(JobGraphUpdateListener listener)
Registers a listener to receive updates when theJobGraph
is modified.- Parameters:
listener
- the listener to register for JobGraph updates.
-
getInitialParallelism
int getInitialParallelism(JobVertexID jobVertexId)
Retrieves the initial parallelism for a given JobVertex ID.- Parameters:
jobVertexId
- the JobVertex ID.- Returns:
- the corresponding initial parallelism.
-
notifyJobVertexParallelismDecided
void notifyJobVertexParallelismDecided(JobVertexID jobVertexId, int parallelism)
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
ExecutionPlanSchedulingContext createExecutionPlanSchedulingContext(int defaultMaxParallelism)
Creates an instance ofExecutionPlanSchedulingContext
.- Parameters:
defaultMaxParallelism
- the default value for maximum parallelism.- Returns:
- an instance of
ExecutionPlanSchedulingContext
.
-
-