public abstract class SchedulerBase extends Object implements SchedulerNG, CheckpointScheduling
SchedulerNG
.Modifier and Type | Field and Description |
---|---|
protected ExecutionVertexVersioner |
executionVertexVersioner |
Constructor and Description |
---|
SchedulerBase(org.slf4j.Logger log,
JobGraph jobGraph,
BackPressureStatsTracker backPressureStatsTracker,
Executor ioExecutor,
Configuration jobMasterConfiguration,
SlotProvider slotProvider,
ScheduledExecutorService futureExecutor,
ClassLoader userCodeLoader,
CheckpointRecoveryFactory checkpointRecoveryFactory,
Time rpcTimeout,
RestartStrategyFactory restartStrategyFactory,
BlobWriter blobWriter,
JobManagerJobMetricGroup jobManagerJobMetricGroup,
Time slotRequestTimeout,
ShuffleMaster<?> shuffleMaster,
JobMasterPartitionTracker partitionTracker,
ExecutionVertexVersioner executionVertexVersioner,
boolean legacyScheduling) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handleGlobalFailure
protected final ExecutionVertexVersioner executionVertexVersioner
public SchedulerBase(org.slf4j.Logger log, JobGraph jobGraph, BackPressureStatsTracker backPressureStatsTracker, Executor ioExecutor, Configuration jobMasterConfiguration, SlotProvider slotProvider, ScheduledExecutorService futureExecutor, ClassLoader userCodeLoader, CheckpointRecoveryFactory checkpointRecoveryFactory, Time rpcTimeout, RestartStrategyFactory restartStrategyFactory, BlobWriter blobWriter, JobManagerJobMetricGroup jobManagerJobMetricGroup, Time slotRequestTimeout, ShuffleMaster<?> shuffleMaster, JobMasterPartitionTracker partitionTracker, ExecutionVertexVersioner executionVertexVersioner, boolean legacyScheduling) throws Exception
Exception
protected void resetForNewExecutions(Collection<ExecutionVertexID> vertices)
protected void restoreState(Set<ExecutionVertexID> vertices, boolean isGlobalRecovery) throws Exception
Exception
protected void transitionToScheduled(List<ExecutionVertexID> verticesToDeploy)
protected ComponentMainThreadExecutor getMainThreadExecutor()
protected void failJob(Throwable cause)
protected final SchedulingTopology getSchedulingTopology()
protected final ResultPartitionAvailabilityChecker getResultPartitionAvailabilityChecker()
protected final InputsLocationsRetriever getInputsLocationsRetriever()
protected final void prepareExecutionGraphForNgScheduling()
protected Optional<ExecutionVertexID> getExecutionVertexId(ExecutionAttemptID executionAttemptId)
protected ExecutionVertexID getExecutionVertexIdOrThrow(ExecutionAttemptID executionAttemptId)
public ExecutionVertex getExecutionVertex(ExecutionVertexID executionVertexId)
public ExecutionJobVertex getExecutionJobVertex(JobVertexID jobVertexId)
protected JobGraph getJobGraph()
protected abstract long getNumberOfRestarts()
protected void transitionExecutionGraphState(JobStatus current, JobStatus newState)
@VisibleForTesting public ExecutionGraph getExecutionGraph()
public void setMainThreadExecutor(ComponentMainThreadExecutor mainThreadExecutor)
setMainThreadExecutor
in interface SchedulerNG
public void registerJobStatusListener(JobStatusListener jobStatusListener)
registerJobStatusListener
in interface SchedulerNG
public final void startScheduling()
startScheduling
in interface SchedulerNG
protected abstract void startSchedulingInternal()
public void suspend(Throwable cause)
suspend
in interface SchedulerNG
public void cancel()
cancel
in interface SchedulerNG
public CompletableFuture<Void> getTerminationFuture()
getTerminationFuture
in interface SchedulerNG
public final boolean updateTaskExecutionState(TaskExecutionState taskExecutionState)
updateTaskExecutionState
in interface SchedulerNG
protected void updateTaskExecutionStateInternal(ExecutionVertexID executionVertexId, TaskExecutionState taskExecutionState)
public SerializedInputSplit requestNextInputSplit(JobVertexID vertexID, ExecutionAttemptID executionAttempt) throws IOException
requestNextInputSplit
in interface SchedulerNG
IOException
public ExecutionState requestPartitionState(IntermediateDataSetID intermediateResultId, ResultPartitionID resultPartitionId) throws PartitionProducerDisposedException
requestPartitionState
in interface SchedulerNG
PartitionProducerDisposedException
public final void scheduleOrUpdateConsumers(ResultPartitionID partitionId)
scheduleOrUpdateConsumers
in interface SchedulerNG
protected void scheduleOrUpdateConsumersInternal(IntermediateResultPartitionID resultPartitionId)
public ArchivedExecutionGraph requestJob()
requestJob
in interface SchedulerNG
public JobStatus requestJobStatus()
requestJobStatus
in interface SchedulerNG
public JobDetails requestJobDetails()
requestJobDetails
in interface SchedulerNG
public KvStateLocation requestKvStateLocation(JobID jobId, String registrationName) throws UnknownKvStateLocation, FlinkJobNotFoundException
requestKvStateLocation
in interface SchedulerNG
UnknownKvStateLocation
FlinkJobNotFoundException
public void notifyKvStateRegistered(JobID jobId, JobVertexID jobVertexId, KeyGroupRange keyGroupRange, String registrationName, KvStateID kvStateId, InetSocketAddress kvStateServerAddress) throws FlinkJobNotFoundException
notifyKvStateRegistered
in interface SchedulerNG
FlinkJobNotFoundException
public void notifyKvStateUnregistered(JobID jobId, JobVertexID jobVertexId, KeyGroupRange keyGroupRange, String registrationName) throws FlinkJobNotFoundException
notifyKvStateUnregistered
in interface SchedulerNG
FlinkJobNotFoundException
public void updateAccumulators(AccumulatorSnapshot accumulatorSnapshot)
updateAccumulators
in interface SchedulerNG
public Optional<OperatorBackPressureStats> requestOperatorBackPressureStats(JobVertexID jobVertexId) throws FlinkException
requestOperatorBackPressureStats
in interface SchedulerNG
FlinkException
public CompletableFuture<String> triggerSavepoint(String targetDirectory, boolean cancelJob)
triggerSavepoint
in interface SchedulerNG
public void stopCheckpointScheduler()
CheckpointScheduling
stopCheckpointScheduler
in interface CheckpointScheduling
public void startCheckpointScheduler()
CheckpointScheduling
startCheckpointScheduler
in interface CheckpointScheduling
public void acknowledgeCheckpoint(JobID jobID, ExecutionAttemptID executionAttemptID, long checkpointId, CheckpointMetrics checkpointMetrics, TaskStateSnapshot checkpointState)
acknowledgeCheckpoint
in interface SchedulerNG
public void declineCheckpoint(DeclineCheckpoint decline)
declineCheckpoint
in interface SchedulerNG
public CompletableFuture<String> stopWithSavepoint(String targetDirectory, boolean terminate)
stopWithSavepoint
in interface SchedulerNG
public void deliverOperatorEventToCoordinator(ExecutionAttemptID taskExecutionId, OperatorID operatorId, OperatorEvent evt) throws FlinkException
SchedulerNG
OperatorCoordinator
with the given OperatorID
.
Failure semantics: If the task manager sends an event for a non-running task or a non-existing operator coordinator, then respond with an exception to the call. If task and coordinator exist, then we assume that the call from the TaskManager was valid, and any bubbling exception needs to cause a job failure
deliverOperatorEventToCoordinator
in interface SchedulerNG
FlinkException
- Thrown, if the task is not running or no operator/coordinator exists
for the given ID.public CompletableFuture<CoordinationResponse> deliverCoordinationRequestToCoordinator(OperatorID operator, CoordinationRequest request) throws FlinkException
SchedulerNG
OperatorCoordinator
with the given OperatorID
and returns the coordinator's response.deliverCoordinationRequestToCoordinator
in interface SchedulerNG
FlinkException
- Thrown, if the task is not running, or no operator/coordinator exists
for the given ID, or the coordinator cannot handle client events.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.