Class MiniDispatcher
- java.lang.Object
-
- org.apache.flink.runtime.rpc.RpcEndpoint
-
- org.apache.flink.runtime.rpc.FencedRpcEndpoint<DispatcherId>
-
- org.apache.flink.runtime.dispatcher.Dispatcher
-
- org.apache.flink.runtime.dispatcher.MiniDispatcher
-
- All Implemented Interfaces:
AutoCloseable
,DispatcherGateway
,FencedRpcGateway<DispatcherId>
,RpcGateway
,RestfulGateway
,AutoCloseableAsync
public class MiniDispatcher extends Dispatcher
Mini Dispatcher which is instantiated as the dispatcher component by theJobClusterEntrypoint
.The mini dispatcher is initialized with a single
ExecutionPlan
which it runs.Depending on the
ClusterEntrypoint.ExecutionMode
, the mini dispatcher will directly terminate after job completion if its execution mode isClusterEntrypoint.ExecutionMode.DETACHED
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.runtime.dispatcher.Dispatcher
Dispatcher.ExecutionType
-
Nested classes/interfaces inherited from class org.apache.flink.runtime.rpc.RpcEndpoint
RpcEndpoint.MainThreadExecutor
-
-
Field Summary
-
Fields inherited from class org.apache.flink.runtime.dispatcher.Dispatcher
CLIENT_ALIVENESS_CHECK_DURATION, DISPATCHER_NAME, shutDownFuture
-
Fields inherited from class org.apache.flink.runtime.rpc.RpcEndpoint
log, rpcServer
-
-
Constructor Summary
Constructors Constructor Description MiniDispatcher(RpcService rpcService, DispatcherId fencingToken, DispatcherServices dispatcherServices, ExecutionPlan executionPlan, JobResult recoveredDirtyJob, DispatcherBootstrapFactory dispatcherBootstrapFactory, JobManagerRunnerRegistry jobManagerRunnerRegistry, ResourceCleanerFactory resourceCleanerFactory, ClusterEntrypoint.ExecutionMode executionMode)
MiniDispatcher(RpcService rpcService, DispatcherId fencingToken, DispatcherServices dispatcherServices, ExecutionPlan executionPlan, JobResult recoveredDirtyJob, DispatcherBootstrapFactory dispatcherBootstrapFactory, ClusterEntrypoint.ExecutionMode executionMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<Acknowledge>
cancelJob(JobID jobId, Duration timeout)
Cancel the given job.CompletableFuture<JobResult>
requestJobResult(JobID jobId, Duration timeout)
Requests theJobResult
of a job specified by the given jobId.protected void
runPostJobGloballyTerminated(JobID jobId, JobStatus jobStatus)
CompletableFuture<Acknowledge>
submitJob(ExecutionPlan executionPlan, Duration timeout)
Submit a job to the dispatcher.-
Methods inherited from class org.apache.flink.runtime.dispatcher.Dispatcher
deliverCoordinationRequestToCoordinator, disposeSavepoint, getBlobServerPort, getShutDownFuture, getTriggeredCheckpointStatus, getTriggeredSavepointStatus, jobReachedTerminalState, listJobs, onFatalError, onRemovedExecutionPlan, onStart, onStop, reportJobClientHeartbeat, requestCheckpointStats, requestClusterOverview, requestExecutionGraphInfo, requestJobResourceRequirements, requestJobStatus, requestMetricQueryServiceAddresses, requestMultipleJobDetails, requestTaskManagerMetricQueryServiceAddresses, requestThreadDump, shutDownCluster, shutDownCluster, stopWithSavepoint, stopWithSavepointAndGetLocation, submitFailedJob, triggerCheckpoint, triggerCheckpoint, triggerCheckpointAndGetCheckpointID, triggerSavepoint, triggerSavepointAndGetLocation, updateJobResourceRequirements
-
Methods inherited from class org.apache.flink.runtime.rpc.FencedRpcEndpoint
getFencingToken
-
Methods inherited from class org.apache.flink.runtime.rpc.RpcEndpoint
callAsync, closeAsync, getAddress, getEndpointId, getHostname, getMainThreadExecutor, getMainThreadExecutor, getRpcService, getSelfGateway, getTerminationFuture, internalCallOnStart, internalCallOnStop, isRunning, registerResource, runAsync, scheduleRunAsync, scheduleRunAsync, start, stop, unregisterResource, validateRunsInMainThread
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.util.AutoCloseableAsync
close
-
Methods inherited from interface org.apache.flink.runtime.rpc.FencedRpcGateway
getFencingToken
-
Methods inherited from interface org.apache.flink.runtime.webmonitor.RestfulGateway
requestJob
-
Methods inherited from interface org.apache.flink.runtime.rpc.RpcGateway
getAddress, getHostname
-
-
-
-
Constructor Detail
-
MiniDispatcher
public MiniDispatcher(RpcService rpcService, DispatcherId fencingToken, DispatcherServices dispatcherServices, @Nullable ExecutionPlan executionPlan, @Nullable JobResult recoveredDirtyJob, DispatcherBootstrapFactory dispatcherBootstrapFactory, ClusterEntrypoint.ExecutionMode executionMode) throws Exception
- Throws:
Exception
-
MiniDispatcher
@VisibleForTesting public MiniDispatcher(RpcService rpcService, DispatcherId fencingToken, DispatcherServices dispatcherServices, @Nullable ExecutionPlan executionPlan, @Nullable JobResult recoveredDirtyJob, DispatcherBootstrapFactory dispatcherBootstrapFactory, JobManagerRunnerRegistry jobManagerRunnerRegistry, ResourceCleanerFactory resourceCleanerFactory, ClusterEntrypoint.ExecutionMode executionMode) throws Exception
- Throws:
Exception
-
-
Method Detail
-
submitJob
public CompletableFuture<Acknowledge> submitJob(ExecutionPlan executionPlan, Duration timeout)
Description copied from interface:DispatcherGateway
Submit a job to the dispatcher.- Specified by:
submitJob
in interfaceDispatcherGateway
- Overrides:
submitJob
in classDispatcher
- Parameters:
executionPlan
- ExecutionPlan to submittimeout
- RPC timeout- Returns:
- A future acknowledge if the submission succeeded
-
requestJobResult
public CompletableFuture<JobResult> requestJobResult(JobID jobId, Duration timeout)
Description copied from interface:RestfulGateway
Requests theJobResult
of a job specified by the given jobId.- Specified by:
requestJobResult
in interfaceRestfulGateway
- Overrides:
requestJobResult
in classDispatcher
- Parameters:
jobId
- identifying the job for which to retrieve theJobResult
.timeout
- for the asynchronous operation- Returns:
- Future which is completed with the job's
JobResult
once the job has finished
-
cancelJob
public CompletableFuture<Acknowledge> cancelJob(JobID jobId, Duration timeout)
Description copied from interface:RestfulGateway
Cancel the given job.- Specified by:
cancelJob
in interfaceRestfulGateway
- Overrides:
cancelJob
in classDispatcher
- Parameters:
jobId
- identifying the job to canceltimeout
- of the operation- Returns:
- A future acknowledge if the cancellation succeeded
-
runPostJobGloballyTerminated
protected void runPostJobGloballyTerminated(JobID jobId, JobStatus jobStatus)
- Overrides:
runPostJobGloballyTerminated
in classDispatcher
-
-