Class DefaultAdaptiveExecutionHandler
- java.lang.Object
-
- org.apache.flink.runtime.scheduler.adaptivebatch.DefaultAdaptiveExecutionHandler
-
- All Implemented Interfaces:
AdaptiveExecutionHandler
public class DefaultAdaptiveExecutionHandler extends Object implements AdaptiveExecutionHandler
TheDefaultAdaptiveExecutionHandlerimplements theAdaptiveExecutionHandlerinterface 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 ExecutionPlanSchedulingContextcreateExecutionPlanSchedulingContext(int defaultMaxParallelism)Creates an instance ofExecutionPlanSchedulingContext.intgetInitialParallelism(JobVertexID jobVertexId)Retrieves the initial parallelism for a given JobVertex ID.JobGraphgetJobGraph()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.voidregisterJobGraphUpdateListener(JobGraphUpdateListener listener)Registers a listener to receive updates when theJobGraphis 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:AdaptiveExecutionHandlerReturns theJobGraphrepresenting the batch job.- Specified by:
getJobGraphin interfaceAdaptiveExecutionHandler- Returns:
- the JobGraph.
-
handleJobEvent
public void handleJobEvent(JobEvent jobEvent)
Description copied from interface:AdaptiveExecutionHandlerHandles the providedJobEvent, attempting dynamic modifications to theStreamGraphbased on the specifics of the job event.- Specified by:
handleJobEventin 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:AdaptiveExecutionHandlerRegisters a listener to receive updates when theJobGraphis modified.- Specified by:
registerJobGraphUpdateListenerin interfaceAdaptiveExecutionHandler- Parameters:
listener- the listener to register for JobGraph updates.
-
getInitialParallelism
public int getInitialParallelism(JobVertexID jobVertexId)
Description copied from interface:AdaptiveExecutionHandlerRetrieves the initial parallelism for a given JobVertex ID.- Specified by:
getInitialParallelismin interfaceAdaptiveExecutionHandler- Parameters:
jobVertexId- the JobVertex ID.- Returns:
- the corresponding initial parallelism.
-
notifyJobVertexParallelismDecided
public void notifyJobVertexParallelismDecided(JobVertexID jobVertexId, int parallelism)
Description copied from interface:AdaptiveExecutionHandlerNotifies the handler that the parallelism of a JobVertex has been decided.- Specified by:
notifyJobVertexParallelismDecidedin 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:AdaptiveExecutionHandlerCreates an instance ofExecutionPlanSchedulingContext.- Specified by:
createExecutionPlanSchedulingContextin interfaceAdaptiveExecutionHandler- Parameters:
defaultMaxParallelism- the default value for maximum parallelism.- Returns:
- an instance of
ExecutionPlanSchedulingContext.
-
-