Interface SchedulerNG
-
- All Superinterfaces:
AutoCloseable,org.apache.flink.util.AutoCloseableAsync,GlobalFailureHandler
- All Known Implementing Classes:
AdaptiveBatchScheduler,AdaptiveScheduler,DefaultScheduler,SchedulerBase
public interface SchedulerNG extends GlobalFailureHandler, org.apache.flink.util.AutoCloseableAsync
Interface for scheduling Flink jobs.Instances are created via
SchedulerNGFactory, and receive aJobGraphwhen 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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidacknowledgeCheckpoint(org.apache.flink.api.common.JobID jobID, ExecutionAttemptID executionAttemptID, long checkpointId, CheckpointMetrics checkpointMetrics, TaskStateSnapshot checkpointState)voidcancel()voiddeclineCheckpoint(DeclineCheckpoint decline)CompletableFuture<CoordinationResponse>deliverCoordinationRequestToCoordinator(OperatorID operator, CoordinationRequest request)Delivers a coordination request to theOperatorCoordinatorwith the givenOperatorIDand returns the coordinator's response.voiddeliverOperatorEventToCoordinator(ExecutionAttemptID taskExecution, OperatorID operator, OperatorEvent evt)Delivers the given OperatorEvent to theOperatorCoordinatorwith the givenOperatorID.CompletableFuture<org.apache.flink.api.common.JobStatus>getJobTerminationFuture()voidnotifyEndOfData(ExecutionAttemptID executionAttemptID)Notifies that the task has reached the end of data.voidnotifyKvStateRegistered(org.apache.flink.api.common.JobID jobId, JobVertexID jobVertexId, KeyGroupRange keyGroupRange, String registrationName, org.apache.flink.queryablestate.KvStateID kvStateId, InetSocketAddress kvStateServerAddress)voidnotifyKvStateUnregistered(org.apache.flink.api.common.JobID jobId, JobVertexID jobVertexId, KeyGroupRange keyGroupRange, String registrationName)voidreportCheckpointMetrics(org.apache.flink.api.common.JobID jobID, ExecutionAttemptID executionAttemptID, long checkpointId, CheckpointMetrics checkpointMetrics)voidreportInitializationMetrics(org.apache.flink.api.common.JobID jobId, ExecutionAttemptID executionAttemptId, SubTaskInitializationMetrics initializationMetrics)CheckpointStatsSnapshotrequestCheckpointStats()Returns the checkpoint statistics for a given job.ExecutionGraphInforequestJob()default JobResourceRequirementsrequestJobResourceRequirements()Read currentjob resource requirements.org.apache.flink.api.common.JobStatusrequestJobStatus()KvStateLocationrequestKvStateLocation(org.apache.flink.api.common.JobID jobId, String registrationName)SerializedInputSplitrequestNextInputSplit(JobVertexID vertexID, ExecutionAttemptID executionAttempt)ExecutionStaterequestPartitionState(IntermediateDataSetID intermediateResultId, ResultPartitionID resultPartitionId)voidstartScheduling()CompletableFuture<String>stopWithSavepoint(String targetDirectory, boolean terminate, org.apache.flink.core.execution.SavepointFormatType formatType)CompletableFuture<CompletedCheckpoint>triggerCheckpoint(org.apache.flink.core.execution.CheckpointType checkpointType)CompletableFuture<String>triggerSavepoint(String targetDirectory, boolean cancelJob, org.apache.flink.core.execution.SavepointFormatType formatType)voidupdateAccumulators(AccumulatorSnapshot accumulatorSnapshot)default voidupdateJobResourceRequirements(JobResourceRequirements jobResourceRequirements)Updatejob resource requirements.booleanupdateTaskExecutionState(TaskExecutionStateTransition taskExecutionState)default booleanupdateTaskExecutionState(TaskExecutionState taskExecutionState)-
Methods inherited from interface org.apache.flink.runtime.scheduler.GlobalFailureHandler
handleGlobalFailure
-
-
-
-
Method Detail
-
startScheduling
void startScheduling()
-
cancel
void cancel()
-
getJobTerminationFuture
CompletableFuture<org.apache.flink.api.common.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 theCheckpointStatsSnapshotis included in theExecutionGraphInfo, this method is preferred torequestJob()because it is less expensive.- Returns:
- checkpoint statistics snapshot for job graph
-
requestJobStatus
org.apache.flink.api.common.JobStatus requestJobStatus()
-
requestKvStateLocation
KvStateLocation requestKvStateLocation(org.apache.flink.api.common.JobID jobId, String registrationName) throws UnknownKvStateLocation, FlinkJobNotFoundException
-
notifyKvStateRegistered
void notifyKvStateRegistered(org.apache.flink.api.common.JobID jobId, JobVertexID jobVertexId, KeyGroupRange keyGroupRange, String registrationName, org.apache.flink.queryablestate.KvStateID kvStateId, InetSocketAddress kvStateServerAddress) throws FlinkJobNotFoundException- Throws:
FlinkJobNotFoundException
-
notifyKvStateUnregistered
void notifyKvStateUnregistered(org.apache.flink.api.common.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, org.apache.flink.core.execution.SavepointFormatType formatType)
-
triggerCheckpoint
CompletableFuture<CompletedCheckpoint> triggerCheckpoint(org.apache.flink.core.execution.CheckpointType checkpointType)
-
acknowledgeCheckpoint
void acknowledgeCheckpoint(org.apache.flink.api.common.JobID jobID, ExecutionAttemptID executionAttemptID, long checkpointId, CheckpointMetrics checkpointMetrics, TaskStateSnapshot checkpointState)
-
reportCheckpointMetrics
void reportCheckpointMetrics(org.apache.flink.api.common.JobID jobID, ExecutionAttemptID executionAttemptID, long checkpointId, CheckpointMetrics checkpointMetrics)
-
declineCheckpoint
void declineCheckpoint(DeclineCheckpoint decline)
-
reportInitializationMetrics
void reportInitializationMetrics(org.apache.flink.api.common.JobID jobId, ExecutionAttemptID executionAttemptId, SubTaskInitializationMetrics initializationMetrics)
-
stopWithSavepoint
CompletableFuture<String> stopWithSavepoint(String targetDirectory, boolean terminate, org.apache.flink.core.execution.SavepointFormatType formatType)
-
deliverOperatorEventToCoordinator
void deliverOperatorEventToCoordinator(ExecutionAttemptID taskExecution, OperatorID operator, OperatorEvent evt) throws org.apache.flink.util.FlinkException
Delivers the given OperatorEvent to theOperatorCoordinatorwith 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:
org.apache.flink.util.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 org.apache.flink.util.FlinkException
Delivers a coordination request to theOperatorCoordinatorwith the givenOperatorIDand returns the coordinator's response.- Returns:
- A future containing the response.
- Throws:
org.apache.flink.util.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
-
-