public class JobManagerRunner extends Object implements LeaderContender, OnCompletionActions, AutoCloseableAsync
Constructor and Description |
---|
JobManagerRunner(JobGraph jobGraph,
JobMasterServiceFactory jobMasterFactory,
HighAvailabilityServices haServices,
LibraryCacheManager libraryCacheManager,
Executor executor,
FatalErrorHandler fatalErrorHandler)
Exceptions that occur while creating the JobManager or JobManagerRunner 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 |
getAddress()
Returns the address of the
LeaderContender under which other instances can connect
to it. |
JobGraph |
getJobGraph() |
CompletableFuture<JobMasterGateway> |
getLeaderGatewayFuture() |
CompletableFuture<ArchivedExecutionGraph> |
getResultFuture() |
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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
public JobManagerRunner(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> getLeaderGatewayFuture()
public JobGraph getJobGraph()
public CompletableFuture<ArchivedExecutionGraph> getResultFuture()
public 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 getAddress()
LeaderContender
LeaderContender
under which other instances can connect
to it.getAddress
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–2020 The Apache Software Foundation. All rights reserved.