public class JobManagerRunner extends Object implements LeaderContender, OnCompletionActions, FatalErrorHandler
Constructor and Description |
---|
JobManagerRunner(ResourceID resourceId,
JobGraph jobGraph,
Configuration configuration,
RpcService rpcService,
HighAvailabilityServices haServices,
HeartbeatServices heartbeatServices,
JobManagerServices jobManagerServices,
MetricRegistry metricRegistry,
OnCompletionActions toNotifyOnComplete,
FatalErrorHandler errorHandler)
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 |
---|---|
String |
getAddress()
Returns the address of the
LeaderContender under which other instances can connect
to it. |
JobMasterGateway |
getJobManagerGateway() |
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 |
jobFailed(Throwable cause)
Job completion notification triggered by JobManager.
|
void |
jobFinished(JobExecutionResult result)
Job completion notification triggered by JobManager.
|
void |
jobFinishedByOther()
Job completion notification triggered by self.
|
void |
onFatalError(Throwable exception)
Job completion notification triggered by JobManager or self.
|
void |
revokeLeadership()
Callback method which is called by the
LeaderElectionService upon revoking the
leadership of a former leader. |
void |
shutdown() |
void |
start() |
public JobManagerRunner(ResourceID resourceId, JobGraph jobGraph, Configuration configuration, RpcService rpcService, HighAvailabilityServices haServices, HeartbeatServices heartbeatServices, JobManagerServices jobManagerServices, MetricRegistry metricRegistry, OnCompletionActions toNotifyOnComplete, FatalErrorHandler errorHandler) throws Exception
FatalErrorHandler
.
This JobManagerRunner assumes that it owns the given JobManagerServices
.
It will shut them down on error and on calls to shutdown()
.
Exception
- Thrown if the runner cannot be set up, because either one of the
required services could not be started, ot the Job could not be initialized.public JobMasterGateway getJobManagerGateway()
public void jobFinished(JobExecutionResult result)
jobFinished
in interface OnCompletionActions
public void jobFailed(Throwable cause)
jobFailed
in interface OnCompletionActions
public void jobFinishedByOther()
jobFinishedByOther
in interface OnCompletionActions
public void onFatalError(Throwable exception)
onFatalError
in interface FatalErrorHandler
exception
- causepublic 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–2018 The Apache Software Foundation. All rights reserved.