public abstract class Dispatcher extends PermanentlyFencedRpcEndpoint<DispatcherId> implements DispatcherGateway
RpcEndpoint.MainThreadExecutor| Modifier and Type | Field and Description |
|---|---|
static String |
DISPATCHER_NAME |
protected CompletableFuture<ApplicationStatus> |
shutDownFuture |
log, rpcServer| Constructor and Description |
|---|
Dispatcher(RpcService rpcService,
String endpointId,
DispatcherId fencingToken,
Collection<JobGraph> recoveredJobs,
DispatcherServices dispatcherServices) |
| 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<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() |
protected void |
jobNotFinished(org.apache.flink.api.common.JobID jobId) |
protected void |
jobReachedGloballyTerminalState(ArchivedExecutionGraph archivedExecutionGraph) |
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()
User overridable callback which is called from
RpcEndpoint.internalCallOnStart(). |
CompletableFuture<Void> |
onStop()
User overridable callback which is called from
RpcEndpoint.internalCallOnStop(). |
CompletableFuture<ClusterOverview> |
requestClusterOverview(org.apache.flink.api.common.time.Time timeout)
Requests the cluster status overview.
|
CompletableFuture<ArchivedExecutionGraph> |
requestJob(org.apache.flink.api.common.JobID jobId,
org.apache.flink.api.common.time.Time timeout)
Requests the
ArchivedExecutionGraph for the given jobId. |
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<OperatorBackPressureStatsResponse> |
requestOperatorBackPressureStats(org.apache.flink.api.common.JobID jobId,
JobVertexID jobVertexId)
Requests the statistics on operator back pressure.
|
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<Acknowledge> |
shutDownCluster() |
CompletableFuture<String> |
stopWithSavepoint(org.apache.flink.api.common.JobID jobId,
String targetDirectory,
boolean advanceToEndOfEventTime,
org.apache.flink.api.common.time.Time timeout)
Stops the job with a savepoint.
|
CompletableFuture<Acknowledge> |
submitJob(JobGraph jobGraph,
org.apache.flink.api.common.time.Time timeout)
Submit a job to the dispatcher.
|
CompletableFuture<String> |
triggerSavepoint(org.apache.flink.api.common.JobID jobId,
String targetDirectory,
boolean cancelJob,
org.apache.flink.api.common.time.Time timeout)
Triggers a savepoint with the given savepoint directory as a target.
|
setFencingTokencallAsyncWithoutFencing, getFencingToken, getMainThreadExecutor, getUnfencedMainThreadExecutor, runAsyncWithoutFencingcallAsync, closeAsync, getAddress, getEndpointId, getHostname, getRpcService, getSelfGateway, getTerminationFuture, internalCallOnStart, internalCallOnStop, isRunning, runAsync, scheduleRunAsync, scheduleRunAsync, start, stop, validateRunsInMainThreadclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFencingTokengetAddress, getHostnamepublic static final String DISPATCHER_NAME
protected final CompletableFuture<ApplicationStatus> shutDownFuture
public Dispatcher(RpcService rpcService, String endpointId, DispatcherId fencingToken, Collection<JobGraph> recoveredJobs, DispatcherServices dispatcherServices) throws Exception
Exceptionpublic CompletableFuture<ApplicationStatus> getShutDownFuture()
public void onStart()
throws Exception
RpcEndpointRpcEndpoint.internalCallOnStart().
This method is called when the RpcEndpoint is being started. The method is guaranteed to be executed in the main thread context and can be used to start the rpc endpoint in the context of the rpc endpoint's main thread.
IMPORTANT: This method should never be called directly by the user.
onStart in class RpcEndpointException - indicating that the rpc endpoint could not be started. If an exception occurs,
then the rpc endpoint will automatically terminate.public CompletableFuture<Void> onStop()
RpcEndpointRpcEndpoint.internalCallOnStop().
This method is called when the RpcEndpoint is being shut down. The method is guaranteed to be executed in the main thread context and can be used to clean up internal state.
IMPORTANT: This method should never be called directly by the user.
onStop in class RpcEndpointpublic CompletableFuture<Acknowledge> submitJob(JobGraph jobGraph, org.apache.flink.api.common.time.Time timeout)
DispatcherGatewaysubmitJob in interface DispatcherGatewayjobGraph - JobGraph to submittimeout - RPC timeoutpublic 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<OperatorBackPressureStatsResponse> requestOperatorBackPressureStats(org.apache.flink.api.common.JobID jobId, JobVertexID jobVertexId)
RestfulGatewayrequestOperatorBackPressureStats in interface RestfulGatewayjobId - Job for which the stats are requested.jobVertexId - JobVertex for which the stats are requested.OperatorBackPressureStatsResponse.public CompletableFuture<ArchivedExecutionGraph> requestJob(org.apache.flink.api.common.JobID jobId, org.apache.flink.api.common.time.Time timeout)
DispatcherGatewayArchivedExecutionGraph for the given jobId. If there is no such graph, then
the future is completed with a FlinkJobNotFoundException.
Note: We enforce that the returned future contains a ArchivedExecutionGraph unlike
the super interface.
requestJob in interface DispatcherGatewayrequestJob in interface RestfulGatewayjobId - identifying the job whose AccessExecutionGraph is requestedtimeout - for the asynchronous operationFlinkJobNotFoundExceptionpublic 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<Integer> getBlobServerPort(org.apache.flink.api.common.time.Time timeout)
DispatcherGatewaygetBlobServerPort in interface DispatcherGatewaytimeout - of the operationpublic CompletableFuture<String> triggerSavepoint(org.apache.flink.api.common.JobID jobId, String targetDirectory, boolean cancelJob, org.apache.flink.api.common.time.Time timeout)
RestfulGatewaytriggerSavepoint in interface RestfulGatewayjobId - ID of the job for which the savepoint should be triggered.targetDirectory - Target directory for the savepoint.timeout - Timeout for the asynchronous operationexternal pointer of
the savepoint.public CompletableFuture<String> stopWithSavepoint(org.apache.flink.api.common.JobID jobId, String targetDirectory, boolean advanceToEndOfEventTime, org.apache.flink.api.common.time.Time timeout)
RestfulGatewaystopWithSavepoint in interface RestfulGatewayjobId - ID of the job for which the savepoint should be triggered.targetDirectory - to which to write the savepoint data or null if the
default savepoint directory should be usedadvanceToEndOfEventTime - Flag indicating if the source should inject a MAX_WATERMARK in the pipeline
to fire any registered event-time timerstimeout - for the rpc callpublic CompletableFuture<Acknowledge> shutDownCluster()
shutDownCluster in interface RestfulGatewayprotected void onFatalError(Throwable throwable)
protected void jobReachedGloballyTerminalState(ArchivedExecutionGraph archivedExecutionGraph)
protected void jobNotFinished(org.apache.flink.api.common.JobID jobId)
public CompletableFuture<Void> onRemovedJobGraph(org.apache.flink.api.common.JobID jobId)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.