Class DefaultJobMasterServiceProcess
- java.lang.Object
-
- org.apache.flink.runtime.jobmaster.DefaultJobMasterServiceProcess
-
- All Implemented Interfaces:
AutoCloseable,OnCompletionActions,JobMasterServiceProcess,org.apache.flink.util.AutoCloseableAsync
public class DefaultJobMasterServiceProcess extends Object implements JobMasterServiceProcess, OnCompletionActions
DefaultJobMasterServiceProcesswhich is responsible for creating and running aJobMasterService. The process is responsible for receiving the signals from theJobMasterServiceand to create the respectiveJobManagerRunnerResultfrom it.The
JobMasterServicecan be created asynchronously and the creation can also fail. That is why the process needs to observe the creation operation and complete theresultFuturewith an initialization failure.The
resultFuturecan be completed with the following values:JobManagerRunnerResultto signal an initialization failure of theJobMasterServiceor the completion of a jobJobNotFinishedExceptionto signal that the job has not been completed by theJobMasterServiceExceptionto signal an unexpected failure
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.jobmaster.JobMasterServiceProcess
JobMasterServiceProcess.WaitingForLeadership
-
-
Constructor Summary
Constructors Constructor Description DefaultJobMasterServiceProcess(org.apache.flink.api.common.JobID jobId, UUID leaderSessionId, JobMasterServiceFactory jobMasterServiceFactory, Function<Throwable,ArchivedExecutionGraph> failedArchivedExecutionGraphFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<Void>closeAsync()CompletableFuture<JobMasterGateway>getJobMasterGatewayFuture()Future which is completed with theJobMasterGatewayonce theJobMasterServicehas been created.CompletableFuture<String>getLeaderAddressFuture()Future which is completed with theJobMasterServiceaddress once it is created.UUIDgetLeaderSessionId()The leader session id of this process.CompletableFuture<JobManagerRunnerResult>getResultFuture()Future which is completed with the result of job execution.booleanisInitializedAndRunning()True iff theJobMasterServicehas been initialized and is running.voidjobMasterFailed(Throwable cause)TheJobMasterfailed while executing the job.voidjobReachedGloballyTerminalState(ExecutionGraphInfo executionGraphInfo)Job reached a globally terminal state.
-
-
-
Constructor Detail
-
DefaultJobMasterServiceProcess
public DefaultJobMasterServiceProcess(org.apache.flink.api.common.JobID jobId, UUID leaderSessionId, JobMasterServiceFactory jobMasterServiceFactory, Function<Throwable,ArchivedExecutionGraph> failedArchivedExecutionGraphFactory)
-
-
Method Detail
-
closeAsync
public CompletableFuture<Void> closeAsync()
- Specified by:
closeAsyncin interfaceorg.apache.flink.util.AutoCloseableAsync
-
getLeaderSessionId
public UUID getLeaderSessionId()
Description copied from interface:JobMasterServiceProcessThe leader session id of this process.- Specified by:
getLeaderSessionIdin interfaceJobMasterServiceProcess
-
isInitializedAndRunning
public boolean isInitializedAndRunning()
Description copied from interface:JobMasterServiceProcessTrue iff theJobMasterServicehas been initialized and is running.- Specified by:
isInitializedAndRunningin interfaceJobMasterServiceProcess
-
getJobMasterGatewayFuture
public CompletableFuture<JobMasterGateway> getJobMasterGatewayFuture()
Description copied from interface:JobMasterServiceProcessFuture which is completed with theJobMasterGatewayonce theJobMasterServicehas been created. Upon closing of the process, this future is completed exceptionally if it is still uncompleted.- Specified by:
getJobMasterGatewayFuturein interfaceJobMasterServiceProcess
-
getResultFuture
public CompletableFuture<JobManagerRunnerResult> getResultFuture()
Description copied from interface:JobMasterServiceProcessFuture which is completed with the result of job execution. The job's result can be theJobManagerRunnerResult,JobNotFinishedExceptionif the job was not finished or anThrowableif an unexpected failure occurs. Upon closing of the process, this future is completed exceptionally withJobNotFinishedException.- Specified by:
getResultFuturein interfaceJobMasterServiceProcess
-
getLeaderAddressFuture
public CompletableFuture<String> getLeaderAddressFuture()
Description copied from interface:JobMasterServiceProcessFuture which is completed with theJobMasterServiceaddress once it is created.- Specified by:
getLeaderAddressFuturein interfaceJobMasterServiceProcess
-
jobReachedGloballyTerminalState
public void jobReachedGloballyTerminalState(ExecutionGraphInfo executionGraphInfo)
Description copied from interface:OnCompletionActionsJob reached a globally terminal state.- Specified by:
jobReachedGloballyTerminalStatein interfaceOnCompletionActions- Parameters:
executionGraphInfo- contains information about the terminated job
-
jobMasterFailed
public void jobMasterFailed(Throwable cause)
Description copied from interface:OnCompletionActionsTheJobMasterfailed while executing the job.- Specified by:
jobMasterFailedin interfaceOnCompletionActions
-
-