public class DefaultJobMasterServiceProcess extends Object implements JobMasterServiceProcess, OnCompletionActions
JobMasterServiceProcess which is responsible for creating and running a JobMasterService. The process is responsible for receiving the signals from the JobMasterService and to create the respective JobManagerRunnerResult from it.
The JobMasterService can be created asynchronously and the creation can also fail.
That is why the process needs to observe the creation operation and complete the resultFuture with an initialization failure.
The resultFuture can be completed with the following values:
JobManagerRunnerResult to signal an initialization failure of the JobMasterService or the completion of a job
JobNotFinishedException to signal that the job has not been completed by the JobMasterService
Exception to signal an unexpected failure
JobMasterServiceProcess.WaitingForLeadership| Constructor and Description |
|---|
DefaultJobMasterServiceProcess(org.apache.flink.api.common.JobID jobId,
UUID leaderSessionId,
JobMasterServiceFactory jobMasterServiceFactory,
Function<Throwable,ArchivedExecutionGraph> failedArchivedExecutionGraphFactory) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
closeAsync() |
CompletableFuture<JobMasterGateway> |
getJobMasterGatewayFuture()
Future which is completed with the
JobMasterGateway once the JobMasterService
has been created. |
CompletableFuture<String> |
getLeaderAddressFuture()
Future which is completed with the
JobMasterService address once it is created. |
UUID |
getLeaderSessionId()
The leader session id of this process.
|
CompletableFuture<JobManagerRunnerResult> |
getResultFuture()
Future which is completed with the result of job execution.
|
boolean |
isInitializedAndRunning()
True iff the
JobMasterService has been initialized and is running. |
void |
jobMasterFailed(Throwable cause)
The
JobMaster failed while executing the job. |
void |
jobReachedGloballyTerminalState(ExecutionGraphInfo executionGraphInfo)
Job reached a globally terminal state.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwaitingForLeadershippublic DefaultJobMasterServiceProcess(org.apache.flink.api.common.JobID jobId,
UUID leaderSessionId,
JobMasterServiceFactory jobMasterServiceFactory,
Function<Throwable,ArchivedExecutionGraph> failedArchivedExecutionGraphFactory)
public CompletableFuture<Void> closeAsync()
closeAsync in interface org.apache.flink.util.AutoCloseableAsyncpublic UUID getLeaderSessionId()
JobMasterServiceProcessgetLeaderSessionId in interface JobMasterServiceProcesspublic boolean isInitializedAndRunning()
JobMasterServiceProcessJobMasterService has been initialized and is running.isInitializedAndRunning in interface JobMasterServiceProcesspublic CompletableFuture<JobMasterGateway> getJobMasterGatewayFuture()
JobMasterServiceProcessJobMasterGateway once the JobMasterService
has been created. Upon closing of the process, this future is completed exceptionally if it
is still uncompleted.getJobMasterGatewayFuture in interface JobMasterServiceProcesspublic CompletableFuture<JobManagerRunnerResult> getResultFuture()
JobMasterServiceProcessJobManagerRunnerResult, JobNotFinishedException if the job was not finished
or an Throwable if an unexpected failure occurs. Upon closing of the process, this
future is completed exceptionally with JobNotFinishedException.getResultFuture in interface JobMasterServiceProcesspublic CompletableFuture<String> getLeaderAddressFuture()
JobMasterServiceProcessJobMasterService address once it is created.getLeaderAddressFuture in interface JobMasterServiceProcesspublic void jobReachedGloballyTerminalState(ExecutionGraphInfo executionGraphInfo)
OnCompletionActionsjobReachedGloballyTerminalState in interface OnCompletionActionsexecutionGraphInfo - contains information about the terminated jobpublic void jobMasterFailed(Throwable cause)
OnCompletionActionsJobMaster failed while executing the job.jobMasterFailed in interface OnCompletionActionsCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.