public abstract class Dispatcher extends org.apache.flink.runtime.rpc.FencedRpcEndpoint<DispatcherId> implements DispatcherGateway
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Dispatcher.ExecutionType
Enum to distinguish between initial job submission and re-submission for recovery.
|
| Modifier and Type | Field and Description |
|---|---|
static org.apache.flink.configuration.ConfigOption<java.time.Duration> |
CLIENT_ALIVENESS_CHECK_DURATION |
static String |
DISPATCHER_NAME |
protected CompletableFuture<ApplicationStatus> |
shutDownFuture |
| Modifier | Constructor and Description |
|---|---|
|
Dispatcher(org.apache.flink.runtime.rpc.RpcService rpcService,
DispatcherId fencingToken,
Collection<JobGraph> recoveredJobs,
Collection<JobResult> recoveredDirtyJobs,
DispatcherBootstrapFactory dispatcherBootstrapFactory,
DispatcherServices dispatcherServices) |
protected |
Dispatcher(org.apache.flink.runtime.rpc.RpcService rpcService,
DispatcherId fencingToken,
Collection<JobGraph> recoveredJobs,
Collection<JobResult> recoveredDirtyJobs,
DispatcherBootstrapFactory dispatcherBootstrapFactory,
DispatcherServices dispatcherServices,
JobManagerRunnerRegistry jobManagerRunnerRegistry,
ResourceCleanerFactory resourceCleanerFactory) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Acknowledge> |
cancelJob(org.apache.flink.api.common.JobID jobId,
org.apache.flink.api.common.time.Time timeout)
Cancel the given job.
|
CompletableFuture<CoordinationResponse> |
deliverCoordinationRequestToCoordinator(org.apache.flink.api.common.JobID jobId,
OperatorID operatorId,
org.apache.flink.util.SerializedValue<CoordinationRequest> serializedRequest,
org.apache.flink.api.common.time.Time timeout)
Deliver a coordination request to a specified coordinator and return the response.
|
CompletableFuture<Acknowledge> |
disposeSavepoint(String savepointPath,
org.apache.flink.api.common.time.Time timeout)
Dispose the given savepoint.
|
CompletableFuture<Integer> |
getBlobServerPort(org.apache.flink.api.common.time.Time timeout)
Returns the port of the blob server.
|
CompletableFuture<ApplicationStatus> |
getShutDownFuture() |
CompletableFuture<OperationResult<Long>> |
getTriggeredCheckpointStatus(AsynchronousJobOperationKey operationKey)
Get the status of a checkpoint triggered under the specified operation key.
|
CompletableFuture<OperationResult<String>> |
getTriggeredSavepointStatus(AsynchronousJobOperationKey operationKey)
Get the status of a savepoint triggered under the specified operation key.
|
protected CompletableFuture<org.apache.flink.runtime.dispatcher.Dispatcher.CleanupJobState> |
jobReachedTerminalState(ExecutionGraphInfo executionGraphInfo) |
CompletableFuture<Collection<org.apache.flink.api.common.JobID>> |
listJobs(org.apache.flink.api.common.time.Time timeout)
List the current set of submitted jobs.
|
protected void |
onFatalError(Throwable throwable) |
CompletableFuture<Void> |
onRemovedJobGraph(org.apache.flink.api.common.JobID jobId) |
void |
onStart() |
CompletableFuture<Void> |
onStop() |
CompletableFuture<Void> |
reportJobClientHeartbeat(org.apache.flink.api.common.JobID jobId,
long expiredTimestamp,
org.apache.flink.api.common.time.Time timeout)
The client reports the heartbeat to the dispatcher for aliveness.
|
CompletableFuture<CheckpointStatsSnapshot> |
requestCheckpointStats(org.apache.flink.api.common.JobID jobId,
org.apache.flink.api.common.time.Time timeout)
Requests the
CheckpointStatsSnapshot containing checkpointing information. |
CompletableFuture<ClusterOverview> |
requestClusterOverview(org.apache.flink.api.common.time.Time timeout)
Requests the cluster status overview.
|
CompletableFuture<ExecutionGraphInfo> |
requestExecutionGraphInfo(org.apache.flink.api.common.JobID jobId,
org.apache.flink.api.common.time.Time timeout)
Requests the
ExecutionGraphInfo containing additional information besides the ArchivedExecutionGraph. |
CompletableFuture<JobResourceRequirements> |
requestJobResourceRequirements(org.apache.flink.api.common.JobID jobId)
Read current
job resource requirements for a given job. |
CompletableFuture<JobResult> |
requestJobResult(org.apache.flink.api.common.JobID jobId,
org.apache.flink.api.common.time.Time timeout)
Requests the
JobResult of a job specified by the given jobId. |
CompletableFuture<org.apache.flink.api.common.JobStatus> |
requestJobStatus(org.apache.flink.api.common.JobID jobId,
org.apache.flink.api.common.time.Time timeout)
Request the
JobStatus of the given job. |
CompletableFuture<Collection<String>> |
requestMetricQueryServiceAddresses(org.apache.flink.api.common.time.Time timeout)
Requests the addresses of the
MetricQueryService to query. |
CompletableFuture<MultipleJobsDetails> |
requestMultipleJobDetails(org.apache.flink.api.common.time.Time timeout)
Requests job details currently being executed on the Flink cluster.
|
CompletableFuture<Collection<org.apache.flink.api.java.tuple.Tuple2<ResourceID,String>>> |
requestTaskManagerMetricQueryServiceAddresses(org.apache.flink.api.common.time.Time timeout)
Requests the addresses for the TaskManagers'
MetricQueryService to query. |
CompletableFuture<ThreadDumpInfo> |
requestThreadDump(org.apache.flink.api.common.time.Time timeout)
Requests the thread dump from the JobManager.
|
protected void |
runPostJobGloballyTerminated(org.apache.flink.api.common.JobID jobId,
org.apache.flink.api.common.JobStatus jobStatus) |
CompletableFuture<Acknowledge> |
shutDownCluster() |
CompletableFuture<Acknowledge> |
shutDownCluster(ApplicationStatus applicationStatus) |
CompletableFuture<Acknowledge> |
stopWithSavepoint(AsynchronousJobOperationKey operationKey,
String targetDirectory,
org.apache.flink.core.execution.SavepointFormatType formatType,
TriggerSavepointMode savepointMode,
org.apache.flink.api.common.time.Time timeout)
Stops the job with a savepoint, returning a future that completes when the operation is
started.
|
CompletableFuture<String> |
stopWithSavepointAndGetLocation(org.apache.flink.api.common.JobID jobId,
String targetDirectory,
org.apache.flink.core.execution.SavepointFormatType formatType,
TriggerSavepointMode savepointMode,
org.apache.flink.api.common.time.Time timeout)
Stops the job with a savepoint, returning a future that completes with the savepoint location
when the savepoint is completed.
|
CompletableFuture<Acknowledge> |
submitFailedJob(org.apache.flink.api.common.JobID jobId,
String jobName,
Throwable exception) |
CompletableFuture<Acknowledge> |
submitJob(JobGraph jobGraph,
org.apache.flink.api.common.time.Time timeout)
Submit a job to the dispatcher.
|
CompletableFuture<Acknowledge> |
triggerCheckpoint(AsynchronousJobOperationKey operationKey,
org.apache.flink.core.execution.CheckpointType checkpointType,
org.apache.flink.api.common.time.Time timeout)
Triggers a checkpoint with the given savepoint directory as a target.
|
CompletableFuture<String> |
triggerCheckpoint(org.apache.flink.api.common.JobID jobID,
org.apache.flink.api.common.time.Time timeout) |
CompletableFuture<Long> |
triggerCheckpointAndGetCheckpointID(org.apache.flink.api.common.JobID jobID,
org.apache.flink.core.execution.CheckpointType checkpointType,
org.apache.flink.api.common.time.Time timeout)
Triggers a checkpoint, returning a future that completes with the checkpoint id when it is
complete.
|
CompletableFuture<Acknowledge> |
triggerSavepoint(AsynchronousJobOperationKey operationKey,
String targetDirectory,
org.apache.flink.core.execution.SavepointFormatType formatType,
TriggerSavepointMode savepointMode,
org.apache.flink.api.common.time.Time timeout)
Triggers a savepoint with the given savepoint directory as a target, returning a future that
completes when the operation is started.
|
CompletableFuture<String> |
triggerSavepointAndGetLocation(org.apache.flink.api.common.JobID jobId,
String targetDirectory,
org.apache.flink.core.execution.SavepointFormatType formatType,
TriggerSavepointMode savepointMode,
org.apache.flink.api.common.time.Time timeout)
Triggers a savepoint with the given savepoint directory as a target, returning a future that
completes with the savepoint location when it is complete.
|
CompletableFuture<Acknowledge> |
updateJobResourceRequirements(org.apache.flink.api.common.JobID jobId,
JobResourceRequirements jobResourceRequirements)
Update
job resource requirements for a given job. |
callAsync, closeAsync, getAddress, getEndpointId, getHostname, getMainThreadExecutor, getRpcService, getSelfGateway, getTerminationFuture, internalCallOnStart, internalCallOnStop, isRunning, registerResource, runAsync, scheduleRunAsync, scheduleRunAsync, start, stop, unregisterResource, validateRunsInMainThreadclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrequestJob@VisibleForTesting public static final org.apache.flink.configuration.ConfigOption<java.time.Duration> CLIENT_ALIVENESS_CHECK_DURATION
public static final String DISPATCHER_NAME
protected final CompletableFuture<ApplicationStatus> shutDownFuture
public Dispatcher(org.apache.flink.runtime.rpc.RpcService rpcService,
DispatcherId fencingToken,
Collection<JobGraph> recoveredJobs,
Collection<JobResult> recoveredDirtyJobs,
DispatcherBootstrapFactory dispatcherBootstrapFactory,
DispatcherServices dispatcherServices)
throws Exception
Exception@VisibleForTesting
protected Dispatcher(org.apache.flink.runtime.rpc.RpcService rpcService,
DispatcherId fencingToken,
Collection<JobGraph> recoveredJobs,
Collection<JobResult> recoveredDirtyJobs,
DispatcherBootstrapFactory dispatcherBootstrapFactory,
DispatcherServices dispatcherServices,
JobManagerRunnerRegistry jobManagerRunnerRegistry,
ResourceCleanerFactory resourceCleanerFactory)
throws Exception
Exceptionpublic CompletableFuture<ApplicationStatus> getShutDownFuture()
public void onStart()
throws Exception
onStart in class org.apache.flink.runtime.rpc.RpcEndpointExceptionpublic CompletableFuture<Void> onStop()
onStop in class org.apache.flink.runtime.rpc.RpcEndpointpublic CompletableFuture<Acknowledge> submitJob(JobGraph jobGraph, org.apache.flink.api.common.time.Time timeout)
DispatcherGatewaysubmitJob in interface DispatcherGatewayjobGraph - JobGraph to submittimeout - RPC timeoutpublic CompletableFuture<Acknowledge> submitFailedJob(org.apache.flink.api.common.JobID jobId, String jobName, Throwable exception)
submitFailedJob in interface DispatcherGatewaypublic CompletableFuture<Collection<org.apache.flink.api.common.JobID>> listJobs(org.apache.flink.api.common.time.Time timeout)
DispatcherGatewaylistJobs in interface DispatcherGatewaytimeout - RPC timeoutpublic CompletableFuture<Acknowledge> disposeSavepoint(String savepointPath, org.apache.flink.api.common.time.Time timeout)
RestfulGatewaydisposeSavepoint in interface RestfulGatewaysavepointPath - identifying the savepoint to disposetimeout - RPC timeoutpublic CompletableFuture<Acknowledge> cancelJob(org.apache.flink.api.common.JobID jobId, org.apache.flink.api.common.time.Time timeout)
RestfulGatewaycancelJob in interface RestfulGatewayjobId - identifying the job to canceltimeout - of the operationpublic CompletableFuture<ClusterOverview> requestClusterOverview(org.apache.flink.api.common.time.Time timeout)
RestfulGatewayrequestClusterOverview in interface RestfulGatewaytimeout - for the asynchronous operationpublic CompletableFuture<MultipleJobsDetails> requestMultipleJobDetails(org.apache.flink.api.common.time.Time timeout)
RestfulGatewayrequestMultipleJobDetails in interface RestfulGatewaytimeout - for the asynchronous operationpublic CompletableFuture<org.apache.flink.api.common.JobStatus> requestJobStatus(org.apache.flink.api.common.JobID jobId, org.apache.flink.api.common.time.Time timeout)
RestfulGatewayJobStatus of the given job.requestJobStatus in interface RestfulGatewayjobId - identifying the job for which to retrieve the JobStatustimeout - for the asynchronous operationJobStatus of the given jobpublic CompletableFuture<ExecutionGraphInfo> requestExecutionGraphInfo(org.apache.flink.api.common.JobID jobId, org.apache.flink.api.common.time.Time timeout)
RestfulGatewayExecutionGraphInfo containing additional information besides the ArchivedExecutionGraph. If there is no such graph, then the future is completed with a
FlinkJobNotFoundException.requestExecutionGraphInfo in interface RestfulGatewayjobId - identifying the job whose ExecutionGraphInfo is requestedtimeout - for the asynchronous operationExecutionGraphInfo for the given jobId, otherwise
FlinkJobNotFoundExceptionpublic CompletableFuture<CheckpointStatsSnapshot> requestCheckpointStats(org.apache.flink.api.common.JobID jobId, org.apache.flink.api.common.time.Time timeout)
RestfulGatewayCheckpointStatsSnapshot containing checkpointing information.requestCheckpointStats in interface RestfulGatewayjobId - identifying the job whose CheckpointStatsSnapshot is requestedtimeout - for the asynchronous operationCheckpointStatsSnapshot for the given jobIdpublic CompletableFuture<JobResult> requestJobResult(org.apache.flink.api.common.JobID jobId, org.apache.flink.api.common.time.Time timeout)
RestfulGatewayJobResult of a job specified by the given jobId.requestJobResult in interface RestfulGatewayjobId - identifying the job for which to retrieve the JobResult.timeout - for the asynchronous operationJobResult once the job has finishedpublic CompletableFuture<Collection<String>> requestMetricQueryServiceAddresses(org.apache.flink.api.common.time.Time timeout)
RestfulGatewayMetricQueryService to query.requestMetricQueryServiceAddresses in interface RestfulGatewaytimeout - for the asynchronous operationpublic CompletableFuture<Collection<org.apache.flink.api.java.tuple.Tuple2<ResourceID,String>>> requestTaskManagerMetricQueryServiceAddresses(org.apache.flink.api.common.time.Time timeout)
RestfulGatewayMetricQueryService to query.requestTaskManagerMetricQueryServiceAddresses in interface RestfulGatewaytimeout - for the asynchronous operationpublic CompletableFuture<ThreadDumpInfo> requestThreadDump(org.apache.flink.api.common.time.Time timeout)
RestfulGatewayrequestThreadDump in interface RestfulGatewaytimeout - timeout of the asynchronous operationpublic CompletableFuture<Integer> getBlobServerPort(org.apache.flink.api.common.time.Time timeout)
DispatcherGatewaygetBlobServerPort in interface DispatcherGatewaytimeout - of the operationpublic CompletableFuture<String> triggerCheckpoint(org.apache.flink.api.common.JobID jobID, org.apache.flink.api.common.time.Time timeout)
triggerCheckpoint in interface DispatcherGatewaypublic CompletableFuture<Acknowledge> triggerCheckpoint(AsynchronousJobOperationKey operationKey, org.apache.flink.core.execution.CheckpointType checkpointType, org.apache.flink.api.common.time.Time timeout)
RestfulGatewaytriggerCheckpoint in interface RestfulGatewayoperationKey - the key of the operation, for deduplication purposescheckpointType - checkpoint backup type (configured / full / incremental)timeout - Timeout for the asynchronous operationexternal pointer of
the savepoint.public CompletableFuture<OperationResult<Long>> getTriggeredCheckpointStatus(AsynchronousJobOperationKey operationKey)
RestfulGatewaygetTriggeredCheckpointStatus in interface RestfulGatewayoperationKey - key of the operationpublic CompletableFuture<Long> triggerCheckpointAndGetCheckpointID(org.apache.flink.api.common.JobID jobID, org.apache.flink.core.execution.CheckpointType checkpointType, org.apache.flink.api.common.time.Time timeout)
DispatcherGatewaytriggerCheckpointAndGetCheckpointID in interface DispatcherGatewayjobID - the job idcheckpointType - checkpoint type of this checkpoint (configured / full / incremental)timeout - Timeout for the asynchronous operationpublic CompletableFuture<Acknowledge> triggerSavepoint(AsynchronousJobOperationKey operationKey, String targetDirectory, org.apache.flink.core.execution.SavepointFormatType formatType, TriggerSavepointMode savepointMode, org.apache.flink.api.common.time.Time timeout)
RestfulGatewaytriggerSavepoint in interface RestfulGatewayoperationKey - the key of the operation, for deduplication purposestargetDirectory - Target directory for the savepoint.formatType - Binary format of the savepoint.savepointMode - context of the savepoint operationtimeout - Timeout for the asynchronous operationpublic CompletableFuture<String> triggerSavepointAndGetLocation(org.apache.flink.api.common.JobID jobId, String targetDirectory, org.apache.flink.core.execution.SavepointFormatType formatType, TriggerSavepointMode savepointMode, org.apache.flink.api.common.time.Time timeout)
DispatcherGatewaytriggerSavepointAndGetLocation in interface DispatcherGatewayjobId - the job idtargetDirectory - Target directory for the savepoint.formatType - Binary format of the savepoint.savepointMode - context of the savepoint operationtimeout - Timeout for the asynchronous operationpublic CompletableFuture<OperationResult<String>> getTriggeredSavepointStatus(AsynchronousJobOperationKey operationKey)
RestfulGatewaygetTriggeredSavepointStatus in interface RestfulGatewayoperationKey - key of the operationpublic CompletableFuture<Acknowledge> stopWithSavepoint(AsynchronousJobOperationKey operationKey, String targetDirectory, org.apache.flink.core.execution.SavepointFormatType formatType, TriggerSavepointMode savepointMode, org.apache.flink.api.common.time.Time timeout)
RestfulGatewaystopWithSavepoint in interface RestfulGatewayoperationKey - key of the operation, for deduplicationtargetDirectory - Target directory for the savepoint.formatType - Binary format of the savepoint.savepointMode - context of the savepoint operationtimeout - for the rpc callpublic CompletableFuture<String> stopWithSavepointAndGetLocation(org.apache.flink.api.common.JobID jobId, String targetDirectory, org.apache.flink.core.execution.SavepointFormatType formatType, TriggerSavepointMode savepointMode, org.apache.flink.api.common.time.Time timeout)
DispatcherGatewaystopWithSavepointAndGetLocation in interface DispatcherGatewayjobId - the job idtargetDirectory - Target directory for the savepoint.savepointMode - context of the savepoint operationtimeout - for the rpc callpublic CompletableFuture<Acknowledge> shutDownCluster()
shutDownCluster in interface RestfulGatewaypublic CompletableFuture<Acknowledge> shutDownCluster(ApplicationStatus applicationStatus)
shutDownCluster in interface DispatcherGatewaypublic CompletableFuture<CoordinationResponse> deliverCoordinationRequestToCoordinator(org.apache.flink.api.common.JobID jobId, OperatorID operatorId, org.apache.flink.util.SerializedValue<CoordinationRequest> serializedRequest, org.apache.flink.api.common.time.Time timeout)
RestfulGatewaydeliverCoordinationRequestToCoordinator in interface RestfulGatewayjobId - identifying the job which the coordinator belongs tooperatorId - identifying the coordinator to receive the requestserializedRequest - serialized request to delivertimeout - RPC timeoutFlinkException if the task is not running, or no
operator/coordinator exists for the given ID, or the coordinator cannot handle client
events.public CompletableFuture<Void> reportJobClientHeartbeat(org.apache.flink.api.common.JobID jobId, long expiredTimestamp, org.apache.flink.api.common.time.Time timeout)
RestfulGatewayreportJobClientHeartbeat in interface RestfulGatewaypublic CompletableFuture<JobResourceRequirements> requestJobResourceRequirements(org.apache.flink.api.common.JobID jobId)
RestfulGatewayjob resource requirements for a given job.requestJobResourceRequirements in interface RestfulGatewayjobId - job to read the resource requirements forpublic CompletableFuture<Acknowledge> updateJobResourceRequirements(org.apache.flink.api.common.JobID jobId, JobResourceRequirements jobResourceRequirements)
RestfulGatewayjob resource requirements for a given job. When the
returned future is complete the requirements have been updated and were persisted in HA, but
the job may not have been rescaled (yet).updateJobResourceRequirements in interface RestfulGatewayjobId - job the given requirements belong tojobResourceRequirements - new resource requirements for the jobprotected void runPostJobGloballyTerminated(org.apache.flink.api.common.JobID jobId,
org.apache.flink.api.common.JobStatus jobStatus)
protected void onFatalError(Throwable throwable)
@VisibleForTesting protected CompletableFuture<org.apache.flink.runtime.dispatcher.Dispatcher.CleanupJobState> jobReachedTerminalState(ExecutionGraphInfo executionGraphInfo)
public CompletableFuture<Void> onRemovedJobGraph(org.apache.flink.api.common.JobID jobId)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.