public class JobManagerRunnerImpl extends Object implements LeaderContender, OnCompletionActions, JobManagerRunner
| Constructor and Description |
|---|
JobManagerRunnerImpl(JobGraph jobGraph,
JobMasterServiceFactory jobMasterFactory,
HighAvailabilityServices haServices,
LibraryCacheManager libraryCacheManager,
Executor executor,
FatalErrorHandler fatalErrorHandler)
Exceptions that occur while creating the JobManager or JobManagerRunnerImpl are directly
thrown and not reported to the given
FatalErrorHandler. |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
closeAsync() |
String |
getDescription()
Returns the description of the
LeaderContender for logging purposes. |
org.apache.flink.api.common.JobID |
getJobID()
Get the job id of the executed job.
|
CompletableFuture<JobMasterGateway> |
getJobMasterGateway()
Get the
JobMasterGateway of the JobMaster. |
CompletableFuture<ArchivedExecutionGraph> |
getResultFuture()
Get the result future of this runner.
|
void |
grantLeadership(UUID leaderSessionID)
Callback method which is called by the
LeaderElectionService upon selecting this
instance as the new leader. |
void |
handleError(Exception exception)
Callback method which is called by
LeaderElectionService in case of an error in the
service thread. |
void |
jobFinishedByOther()
Job completion notification triggered by self.
|
void |
jobMasterFailed(Throwable cause)
The
JobMaster failed while executing the job. |
void |
jobReachedGloballyTerminalState(ArchivedExecutionGraph executionGraph)
Job completion notification triggered by JobManager.
|
void |
revokeLeadership()
Callback method which is called by the
LeaderElectionService upon revoking the
leadership of a former leader. |
void |
start()
Start the execution of the
JobMaster. |
public JobManagerRunnerImpl(JobGraph jobGraph, JobMasterServiceFactory jobMasterFactory, HighAvailabilityServices haServices, LibraryCacheManager libraryCacheManager, Executor executor, FatalErrorHandler fatalErrorHandler) throws Exception
FatalErrorHandler.Exception - Thrown if the runner cannot be set up, because either one of the
required services could not be started, or the Job could not be initialized.public CompletableFuture<JobMasterGateway> getJobMasterGateway()
JobManagerRunnerJobMasterGateway of the JobMaster. The future is
only completed if the JobMaster becomes leader.getJobMasterGateway in interface JobManagerRunnerpublic CompletableFuture<ArchivedExecutionGraph> getResultFuture()
JobManagerRunnergetResultFuture in interface JobManagerRunnerpublic org.apache.flink.api.common.JobID getJobID()
JobManagerRunnergetJobID in interface JobManagerRunnerpublic void start()
throws Exception
JobManagerRunnerJobMaster.start in interface JobManagerRunnerException - if the JobMaster cannot be startedpublic CompletableFuture<Void> closeAsync()
closeAsync in interface org.apache.flink.util.AutoCloseableAsyncpublic void jobReachedGloballyTerminalState(ArchivedExecutionGraph executionGraph)
jobReachedGloballyTerminalState in interface OnCompletionActionsexecutionGraph - serializable execution graphpublic void jobFinishedByOther()
jobFinishedByOther in interface OnCompletionActionspublic void jobMasterFailed(Throwable cause)
OnCompletionActionsJobMaster failed while executing the job.jobMasterFailed in interface OnCompletionActionspublic void grantLeadership(UUID leaderSessionID)
LeaderContenderLeaderElectionService upon selecting this
instance as the new leader. The method is called with the new leader session ID.grantLeadership in interface LeaderContenderleaderSessionID - New leader session IDpublic void revokeLeadership()
LeaderContenderLeaderElectionService upon revoking the
leadership of a former leader. This might happen in case that multiple contenders have
been granted leadership.revokeLeadership in interface LeaderContenderpublic String getDescription()
LeaderContenderLeaderContender for logging purposes.getDescription in interface LeaderContenderpublic void handleError(Exception exception)
LeaderContenderLeaderElectionService in case of an error in the
service thread.handleError in interface LeaderContenderexception - Caught exceptionCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.