Class DefaultJobMasterServiceProcess
- java.lang.Object
-
- org.apache.flink.runtime.jobmaster.DefaultJobMasterServiceProcess
-
- All Implemented Interfaces:
AutoCloseable
,OnCompletionActions
,JobMasterServiceProcess
,AutoCloseableAsync
public class DefaultJobMasterServiceProcess extends Object implements JobMasterServiceProcess, OnCompletionActions
DefaultJobMasterServiceProcess
which is responsible for creating and running aJobMasterService
. The process is responsible for receiving the signals from theJobMasterService
and to create the respectiveJobManagerRunnerResult
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 theresultFuture
with an initialization failure.The
resultFuture
can be completed with the following values:JobManagerRunnerResult
to signal an initialization failure of theJobMasterService
or the completion of a jobJobNotFinishedException
to signal that the job has not been completed by theJobMasterService
Exception
to 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(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()
Trigger the closing of the resource and return the corresponding close future.CompletableFuture<JobMasterGateway>
getJobMasterGatewayFuture()
Future which is completed with theJobMasterGateway
once theJobMasterService
has been created.CompletableFuture<String>
getLeaderAddressFuture()
Future which is completed with theJobMasterService
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 theJobMasterService
has been initialized and is running.void
jobMasterFailed(Throwable cause)
TheJobMaster
failed while executing the job.void
jobReachedGloballyTerminalState(ExecutionGraphInfo executionGraphInfo)
Job reached a globally terminal state.-
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
-
-
-
-
Constructor Detail
-
DefaultJobMasterServiceProcess
public DefaultJobMasterServiceProcess(JobID jobId, UUID leaderSessionId, JobMasterServiceFactory jobMasterServiceFactory, Function<Throwable,ArchivedExecutionGraph> failedArchivedExecutionGraphFactory)
-
-
Method Detail
-
closeAsync
public CompletableFuture<Void> closeAsync()
Description copied from interface:AutoCloseableAsync
Trigger the closing of the resource and return the corresponding close future.- Specified by:
closeAsync
in interfaceAutoCloseableAsync
- Returns:
- Future which is completed once the resource has been closed
-
getLeaderSessionId
public UUID getLeaderSessionId()
Description copied from interface:JobMasterServiceProcess
The leader session id of this process.- Specified by:
getLeaderSessionId
in interfaceJobMasterServiceProcess
-
isInitializedAndRunning
public boolean isInitializedAndRunning()
Description copied from interface:JobMasterServiceProcess
True iff theJobMasterService
has been initialized and is running.- Specified by:
isInitializedAndRunning
in interfaceJobMasterServiceProcess
-
getJobMasterGatewayFuture
public CompletableFuture<JobMasterGateway> getJobMasterGatewayFuture()
Description copied from interface:JobMasterServiceProcess
Future which is completed with theJobMasterGateway
once theJobMasterService
has been created. Upon closing of the process, this future is completed exceptionally if it is still uncompleted.- Specified by:
getJobMasterGatewayFuture
in interfaceJobMasterServiceProcess
-
getResultFuture
public CompletableFuture<JobManagerRunnerResult> getResultFuture()
Description copied from interface:JobMasterServiceProcess
Future which is completed with the result of job execution. The job's result can be theJobManagerRunnerResult
,JobNotFinishedException
if the job was not finished or anThrowable
if an unexpected failure occurs. Upon closing of the process, this future is completed exceptionally withJobNotFinishedException
.- Specified by:
getResultFuture
in interfaceJobMasterServiceProcess
-
getLeaderAddressFuture
public CompletableFuture<String> getLeaderAddressFuture()
Description copied from interface:JobMasterServiceProcess
Future which is completed with theJobMasterService
address once it is created.- Specified by:
getLeaderAddressFuture
in interfaceJobMasterServiceProcess
-
jobReachedGloballyTerminalState
public void jobReachedGloballyTerminalState(ExecutionGraphInfo executionGraphInfo)
Description copied from interface:OnCompletionActions
Job reached a globally terminal state.- Specified by:
jobReachedGloballyTerminalState
in interfaceOnCompletionActions
- Parameters:
executionGraphInfo
- contains information about the terminated job
-
jobMasterFailed
public void jobMasterFailed(Throwable cause)
Description copied from interface:OnCompletionActions
TheJobMaster
failed while executing the job.- Specified by:
jobMasterFailed
in interfaceOnCompletionActions
-
-