Class DefaultAdaptiveExecutionHandler
- java.lang.Object
-
- org.apache.flink.runtime.scheduler.adaptivebatch.DefaultAdaptiveExecutionHandler
-
- All Implemented Interfaces:
AdaptiveExecutionHandler
public class DefaultAdaptiveExecutionHandler extends Object implements AdaptiveExecutionHandler
TheDefaultAdaptiveExecutionHandler
implements theAdaptiveExecutionHandler
interface to provide an incrementally generated job graph.This handler can modify the execution plan before downstream job vertices are created, allowing for flexibility and adaptability during runtime.
-
-
Constructor Summary
Constructors Constructor Description DefaultAdaptiveExecutionHandler(ClassLoader userClassloader, StreamGraph streamGraph, Executor serializationExecutor)
-
Method Summary
All Methods Instance Methods Concrete 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.
-
-
-
Constructor Detail
-
DefaultAdaptiveExecutionHandler
public DefaultAdaptiveExecutionHandler(ClassLoader userClassloader, StreamGraph streamGraph, Executor serializationExecutor) throws org.apache.flink.util.DynamicCodeLoadingException
- Throws:
org.apache.flink.util.DynamicCodeLoadingException
-
-
Method Detail
-
getJobGraph
public JobGraph getJobGraph()
Description copied from interface:AdaptiveExecutionHandler
Returns theJobGraph
representing the batch job.- Specified by:
getJobGraph
in interfaceAdaptiveExecutionHandler
- Returns:
- the JobGraph.
-
handleJobEvent
public void handleJobEvent(JobEvent jobEvent)
Description copied from interface:AdaptiveExecutionHandler
Handles the providedJobEvent
, attempting dynamic modifications to theStreamGraph
based on the specifics of the job event.- Specified by:
handleJobEvent
in interfaceAdaptiveExecutionHandler
- Parameters:
jobEvent
- The job event to handle. This event contains the necessary information that might trigger adjustments to the StreamGraph.
-
registerJobGraphUpdateListener
public void registerJobGraphUpdateListener(JobGraphUpdateListener listener)
Description copied from interface:AdaptiveExecutionHandler
Registers a listener to receive updates when theJobGraph
is modified.- Specified by:
registerJobGraphUpdateListener
in interfaceAdaptiveExecutionHandler
- Parameters:
listener
- the listener to register for JobGraph updates.
-
getInitialParallelism
public int getInitialParallelism(JobVertexID jobVertexId)
Description copied from interface:AdaptiveExecutionHandler
Retrieves the initial parallelism for a given JobVertex ID.- Specified by:
getInitialParallelism
in interfaceAdaptiveExecutionHandler
- Parameters:
jobVertexId
- the JobVertex ID.- Returns:
- the corresponding initial parallelism.
-
notifyJobVertexParallelismDecided
public void notifyJobVertexParallelismDecided(JobVertexID jobVertexId, int parallelism)
Description copied from interface:AdaptiveExecutionHandler
Notifies the handler that the parallelism of a JobVertex has been decided.- Specified by:
notifyJobVertexParallelismDecided
in interfaceAdaptiveExecutionHandler
- Parameters:
jobVertexId
- the identifier of the JobVertex whose parallelism was decided.parallelism
- the decided parallelism of the JobVertex.
-
createExecutionPlanSchedulingContext
public ExecutionPlanSchedulingContext createExecutionPlanSchedulingContext(int defaultMaxParallelism)
Description copied from interface:AdaptiveExecutionHandler
Creates an instance ofExecutionPlanSchedulingContext
.- Specified by:
createExecutionPlanSchedulingContext
in interfaceAdaptiveExecutionHandler
- Parameters:
defaultMaxParallelism
- the default value for maximum parallelism.- Returns:
- an instance of
ExecutionPlanSchedulingContext
.
-
-