Class DefaultScheduler
java.lang.Object
org.apache.flink.runtime.scheduler.SchedulerBase
org.apache.flink.runtime.scheduler.DefaultScheduler
- All Implemented Interfaces:
AutoCloseable,CheckpointScheduling,GlobalFailureHandler,SchedulerNG,SchedulerOperations,org.apache.flink.util.AutoCloseableAsync
- Direct Known Subclasses:
AdaptiveBatchScheduler
The future default scheduler.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ExecutionDeployerprotected final ExecutionSlotAllocatorprotected final FailoverStrategyprotected final org.slf4j.Loggerprotected final SchedulingStrategyprotected final ShuffleMaster<?>Fields inherited from class org.apache.flink.runtime.scheduler.SchedulerBase
executionVertexVersioner, inputsLocationsRetriever, jobInfo, jobManagerJobMetricGroup, operatorCoordinatorHandler, stateLocationRetriever -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefaultScheduler(org.slf4j.Logger log, JobGraph jobGraph, Executor ioExecutor, org.apache.flink.configuration.Configuration jobMasterConfiguration, Consumer<org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor> startUpAction, org.apache.flink.util.concurrent.ScheduledExecutor delayExecutor, ClassLoader userCodeLoader, CheckpointsCleaner checkpointsCleaner, CheckpointRecoveryFactory checkpointRecoveryFactory, JobManagerJobMetricGroup jobManagerJobMetricGroup, SchedulingStrategyFactory schedulingStrategyFactory, FailoverStrategy.Factory failoverStrategyFactory, RestartBackoffTimeStrategy restartBackoffTimeStrategy, ExecutionOperations executionOperations, ExecutionVertexVersioner executionVertexVersioner, ExecutionSlotAllocatorFactory executionSlotAllocatorFactory, long initializationTimestamp, org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor mainThreadExecutor, JobStatusListener jobStatusListener, Collection<org.apache.flink.core.failure.FailureEnricher> failureEnrichers, ExecutionGraphFactory executionGraphFactory, ShuffleMaster<?> shuffleMaster, Duration rpcTimeout, VertexParallelismStore vertexParallelismStore, ExecutionDeployer.Factory executionDeployerFactory, ExecutionPlanSchedulingContext executionPlanSchedulingContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidallocateSlotsAndDeploy(List<ExecutionVertexID> verticesToDeploy) Allocate slots and deploy the vertex when slots are returned.protected voidcancelAllPendingSlotRequestsForVertex(ExecutionVertexID executionVertexId) protected voidprotected CompletableFuture<?>cancelExecution(Execution execution) protected FailureHandlingResultSnapshotcreateFailureHandlingResultSnapshot(FailureHandlingResult failureHandlingResult) protected longprotected longprotected ClassLoadervoidhandleGlobalFailure(Throwable error) Handles a global failure.protected voidhandleTaskFailure(Execution failedExecution, Throwable error) protected voidmaybeRestartTasks(FailureHandlingResult failureHandlingResult) protected voidnotifyCoordinatorsAboutTaskFailure(Execution execution, Throwable error) protected voidonTaskFailed(Execution execution) protected voidonTaskFinished(Execution execution, IOMetrics ioMetrics) protected FailureHandlingResultrecordTaskFailure(Execution failedExecution, Throwable error) protected voidMethods inherited from class org.apache.flink.runtime.scheduler.SchedulerBase
acknowledgeCheckpoint, archiveFromFailureHandlingResult, archiveGlobalFailure, cancel, closeAsync, computeVertexParallelismStore, computeVertexParallelismStore, computeVertexParallelismStore, computeVertexParallelismStore, declineCheckpoint, deliverCoordinationRequestToCoordinator, deliverOperatorEventToCoordinator, failJob, getDefaultMaxParallelism, getDefaultMaxParallelism, getExceptionHistory, getExecutionGraph, getExecutionJobVertex, getExecutionVertex, getJobGraph, getJobId, getJobTerminationFuture, getMainThreadExecutor, getMarkPartitionFinishedStrategy, getResultPartitionAvailabilityChecker, getSchedulingTopology, notifyEndOfData, notifyKvStateRegistered, notifyKvStateUnregistered, registerJobMetrics, reportCheckpointMetrics, reportInitializationMetrics, requestCheckpointStats, requestJob, requestJobStatus, requestKvStateLocation, requestNextInputSplit, requestPartitionState, resetForNewExecution, resetForNewExecutions, restoreState, setGlobalFailureCause, startCheckpointScheduler, startScheduling, stopCheckpointScheduler, stopWithSavepoint, transitionExecutionGraphState, transitionToRunning, transitionToScheduled, triggerCheckpoint, triggerSavepoint, updateAccumulators, updateTaskExecutionStateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.util.AutoCloseableAsync
closeMethods inherited from interface org.apache.flink.runtime.scheduler.SchedulerNG
requestJobResourceRequirements, updateJobResourceRequirements, updateTaskExecutionState
-
Field Details
-
log
protected final org.slf4j.Logger log -
executionSlotAllocator
-
schedulingStrategy
-
shuffleMaster
-
executionDeployer
-
failoverStrategy
-
-
Constructor Details
-
DefaultScheduler
protected DefaultScheduler(org.slf4j.Logger log, JobGraph jobGraph, Executor ioExecutor, org.apache.flink.configuration.Configuration jobMasterConfiguration, Consumer<org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor> startUpAction, org.apache.flink.util.concurrent.ScheduledExecutor delayExecutor, ClassLoader userCodeLoader, CheckpointsCleaner checkpointsCleaner, CheckpointRecoveryFactory checkpointRecoveryFactory, JobManagerJobMetricGroup jobManagerJobMetricGroup, SchedulingStrategyFactory schedulingStrategyFactory, FailoverStrategy.Factory failoverStrategyFactory, RestartBackoffTimeStrategy restartBackoffTimeStrategy, ExecutionOperations executionOperations, ExecutionVertexVersioner executionVertexVersioner, ExecutionSlotAllocatorFactory executionSlotAllocatorFactory, long initializationTimestamp, org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor mainThreadExecutor, JobStatusListener jobStatusListener, Collection<org.apache.flink.core.failure.FailureEnricher> failureEnrichers, ExecutionGraphFactory executionGraphFactory, ShuffleMaster<?> shuffleMaster, Duration rpcTimeout, VertexParallelismStore vertexParallelismStore, ExecutionDeployer.Factory executionDeployerFactory, ExecutionPlanSchedulingContext executionPlanSchedulingContext) throws Exception - Throws:
Exception
-
-
Method Details
-
getNumberOfRestarts
protected long getNumberOfRestarts()- Specified by:
getNumberOfRestartsin classSchedulerBase
-
getNumberOfRescales
protected long getNumberOfRescales()- Specified by:
getNumberOfRescalesin classSchedulerBase
-
cancelAllPendingSlotRequestsInternal
protected void cancelAllPendingSlotRequestsInternal()- Specified by:
cancelAllPendingSlotRequestsInternalin classSchedulerBase
-
startSchedulingInternal
protected void startSchedulingInternal()- Specified by:
startSchedulingInternalin classSchedulerBase
-
onTaskFinished
- Specified by:
onTaskFinishedin classSchedulerBase
-
getUserCodeLoader
-
onTaskFailed
- Specified by:
onTaskFailedin classSchedulerBase
-
handleTaskFailure
-
recordTaskFailure
protected FailureHandlingResult recordTaskFailure(Execution failedExecution, @Nullable Throwable error) -
notifyCoordinatorsAboutTaskFailure
-
handleGlobalFailure
Description copied from interface:GlobalFailureHandlerHandles a global failure.- Specified by:
handleGlobalFailurein interfaceGlobalFailureHandler- Parameters:
error- A cause that describes the global failure.
-
maybeRestartTasks
-
createFailureHandlingResultSnapshot
protected FailureHandlingResultSnapshot createFailureHandlingResultSnapshot(FailureHandlingResult failureHandlingResult) -
cancelExecution
-
cancelAllPendingSlotRequestsForVertex
-
allocateSlotsAndDeploy
Description copied from interface:SchedulerOperationsAllocate slots and deploy the vertex when slots are returned. Vertices will be deployed only after all of them have been assigned slots. The given order will be respected, i.e. tasks with smaller indices will be deployed earlier. Only vertices in CREATED state will be accepted. Errors will happen if scheduling Non-CREATED vertices.- Specified by:
allocateSlotsAndDeployin interfaceSchedulerOperations- Parameters:
verticesToDeploy- The execution vertices to deploy
-