Interface SchedulerNG
-
- All Superinterfaces:
AutoCloseable
,AutoCloseableAsync
,GlobalFailureHandler
- All Known Implementing Classes:
AdaptiveBatchScheduler
,AdaptiveScheduler
,DefaultScheduler
,SchedulerBase
public interface SchedulerNG extends GlobalFailureHandler, AutoCloseableAsync
Interface for scheduling Flink jobs.Instances are created via
SchedulerNGFactory
, and receive aJobGraph
when instantiated.Implementations can expect that methods will not be invoked concurrently. In fact, all invocations will originate from a thread in the
ComponentMainThreadExecutor
.
-
-
Method Summary
-
Methods inherited from interface org.apache.flink.util.AutoCloseableAsync
close, closeAsync
-
Methods inherited from interface org.apache.flink.runtime.scheduler.GlobalFailureHandler
handleGlobalFailure
-
-
-
-
Method Detail
-
startScheduling
void startScheduling()
-
cancel
void cancel()
-
getJobTerminationFuture
CompletableFuture<JobStatus> getJobTerminationFuture()
-
updateTaskExecutionState
default boolean updateTaskExecutionState(TaskExecutionState taskExecutionState)
-
updateTaskExecutionState
boolean updateTaskExecutionState(TaskExecutionStateTransition taskExecutionState)
-
requestNextInputSplit
SerializedInputSplit requestNextInputSplit(JobVertexID vertexID, ExecutionAttemptID executionAttempt) throws IOException
- Throws:
IOException
-
requestPartitionState
ExecutionState requestPartitionState(IntermediateDataSetID intermediateResultId, ResultPartitionID resultPartitionId) throws PartitionProducerDisposedException
-
requestJob
ExecutionGraphInfo requestJob()
-
requestCheckpointStats
CheckpointStatsSnapshot requestCheckpointStats()
Returns the checkpoint statistics for a given job. Although theCheckpointStatsSnapshot
is included in theExecutionGraphInfo
, this method is preferred torequestJob()
because it is less expensive.- Returns:
- checkpoint statistics snapshot for job graph
-
requestJobStatus
JobStatus requestJobStatus()
-
requestKvStateLocation
KvStateLocation requestKvStateLocation(JobID jobId, String registrationName) throws UnknownKvStateLocation, FlinkJobNotFoundException
-
notifyKvStateRegistered
void notifyKvStateRegistered(JobID jobId, JobVertexID jobVertexId, KeyGroupRange keyGroupRange, String registrationName, KvStateID kvStateId, InetSocketAddress kvStateServerAddress) throws FlinkJobNotFoundException
- Throws:
FlinkJobNotFoundException
-
notifyKvStateUnregistered
void notifyKvStateUnregistered(JobID jobId, JobVertexID jobVertexId, KeyGroupRange keyGroupRange, String registrationName) throws FlinkJobNotFoundException
- Throws:
FlinkJobNotFoundException
-
updateAccumulators
void updateAccumulators(AccumulatorSnapshot accumulatorSnapshot)
-
triggerSavepoint
CompletableFuture<String> triggerSavepoint(@Nullable String targetDirectory, boolean cancelJob, SavepointFormatType formatType)
-
triggerCheckpoint
CompletableFuture<CompletedCheckpoint> triggerCheckpoint(CheckpointType checkpointType)
-
acknowledgeCheckpoint
void acknowledgeCheckpoint(JobID jobID, ExecutionAttemptID executionAttemptID, long checkpointId, CheckpointMetrics checkpointMetrics, TaskStateSnapshot checkpointState)
-
reportCheckpointMetrics
void reportCheckpointMetrics(JobID jobID, ExecutionAttemptID executionAttemptID, long checkpointId, CheckpointMetrics checkpointMetrics)
-
declineCheckpoint
void declineCheckpoint(DeclineCheckpoint decline)
-
reportInitializationMetrics
void reportInitializationMetrics(JobID jobId, ExecutionAttemptID executionAttemptId, SubTaskInitializationMetrics initializationMetrics)
-
stopWithSavepoint
CompletableFuture<String> stopWithSavepoint(String targetDirectory, boolean terminate, SavepointFormatType formatType)
-
deliverOperatorEventToCoordinator
void deliverOperatorEventToCoordinator(ExecutionAttemptID taskExecution, OperatorID operator, OperatorEvent evt) throws FlinkException
Delivers the given OperatorEvent to theOperatorCoordinator
with the givenOperatorID
.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
- Throws:
FlinkException
- Thrown, if the task is not running or no operator/coordinator exists for the given ID.
-
deliverCoordinationRequestToCoordinator
CompletableFuture<CoordinationResponse> deliverCoordinationRequestToCoordinator(OperatorID operator, CoordinationRequest request) throws FlinkException
Delivers a coordination request to theOperatorCoordinator
with the givenOperatorID
and returns the coordinator's response.- Returns:
- A future containing the response.
- Throws:
FlinkException
- Thrown, if the task is not running, or no operator/coordinator exists for the given ID, or the coordinator cannot handle client events.
-
notifyEndOfData
void notifyEndOfData(ExecutionAttemptID executionAttemptID)
Notifies that the task has reached the end of data.- Parameters:
executionAttemptID
- The execution attempt id.
-
requestJobResourceRequirements
default JobResourceRequirements requestJobResourceRequirements()
Read currentjob resource requirements
.- Returns:
- Current resource requirements.
-
updateJobResourceRequirements
default void updateJobResourceRequirements(JobResourceRequirements jobResourceRequirements)
Updatejob resource requirements
.- Parameters:
jobResourceRequirements
- new resource requirements
-
-