public class JobManagerRunnerImpl extends Object implements LeaderContender, OnCompletionActions, JobManagerRunner
Constructor and Description |
---|
JobManagerRunnerImpl(JobGraph jobGraph,
JobMasterServiceFactory jobMasterFactory,
HighAvailabilityServices haServices,
LibraryCacheManager.ClassLoaderLease classLoaderLease,
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()
Trigger the closing of the resource and return the corresponding close future.
|
String |
getDescription()
Returns the description of the
LeaderContender for logging purposes. |
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 . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
public JobManagerRunnerImpl(JobGraph jobGraph, JobMasterServiceFactory jobMasterFactory, HighAvailabilityServices haServices, LibraryCacheManager.ClassLoaderLease classLoaderLease, 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()
JobManagerRunner
JobMasterGateway
of the JobMaster
. The future is only completed if
the JobMaster becomes leader.getJobMasterGateway
in interface JobManagerRunner
public CompletableFuture<ArchivedExecutionGraph> getResultFuture()
JobManagerRunner
getResultFuture
in interface JobManagerRunner
public JobID getJobID()
JobManagerRunner
getJobID
in interface JobManagerRunner
public void start() throws Exception
JobManagerRunner
JobMaster
.start
in interface JobManagerRunner
Exception
- if the JobMaster cannot be startedpublic CompletableFuture<Void> closeAsync()
AutoCloseableAsync
closeAsync
in interface AutoCloseableAsync
public void jobReachedGloballyTerminalState(ArchivedExecutionGraph executionGraph)
jobReachedGloballyTerminalState
in interface OnCompletionActions
executionGraph
- serializable execution graphpublic void jobFinishedByOther()
jobFinishedByOther
in interface OnCompletionActions
public void jobMasterFailed(Throwable cause)
OnCompletionActions
JobMaster
failed while executing the job.jobMasterFailed
in interface OnCompletionActions
public void grantLeadership(UUID leaderSessionID)
LeaderContender
LeaderElectionService
upon selecting this
instance as the new leader. The method is called with the new leader session ID.grantLeadership
in interface LeaderContender
leaderSessionID
- New leader session IDpublic void revokeLeadership()
LeaderContender
LeaderElectionService
upon revoking the
leadership of a former leader. This might happen in case that multiple contenders have been
granted leadership.revokeLeadership
in interface LeaderContender
public String getDescription()
LeaderContender
LeaderContender
for logging purposes.getDescription
in interface LeaderContender
public void handleError(Exception exception)
LeaderContender
LeaderElectionService
in case of an error in the
service thread.handleError
in interface LeaderContender
exception
- Caught exceptionCopyright © 2014–2021 The Apache Software Foundation. All rights reserved.