public class JobLeaderService extends Object
Constructor and Description |
---|
JobLeaderService(TaskManagerLocation location) |
Modifier and Type | Method and Description |
---|---|
void |
addJob(JobID jobId,
String defaultTargetAddress)
Add the given job to be monitored.
|
boolean |
containsJob(JobID jobId)
Check whether the service monitors the given job.
|
void |
reconnect(JobID jobId)
Triggers reconnection to the last known leader of the given job.
|
void |
removeJob(JobID jobId)
Remove the given job from being monitored by the job leader service.
|
void |
start(String initialOwnerAddress,
RpcService initialRpcService,
HighAvailabilityServices initialHighAvailabilityServices,
JobLeaderListener initialJobLeaderListener)
Start the job leader service with the given services.
|
void |
stop()
Stop the job leader services.
|
public JobLeaderService(TaskManagerLocation location)
public void start(String initialOwnerAddress, RpcService initialRpcService, HighAvailabilityServices initialHighAvailabilityServices, JobLeaderListener initialJobLeaderListener)
initialOwnerAddress
- to be used for establishing connections (source address)initialRpcService
- to be used to create rpc connectionsinitialHighAvailabilityServices
- to create leader retrieval services for the different jobsinitialJobLeaderListener
- listening for job leader changespublic void stop() throws Exception
Exception
- if an error occurs while stopping the servicepublic void removeJob(JobID jobId) throws Exception
jobId
- identifying the job to remove from monitoringException
- if an error occurred while stopping the leader retrieval service and listenerpublic void addJob(JobID jobId, String defaultTargetAddress) throws Exception
jobId
- identifying the job to monitordefaultTargetAddress
- of the job leaderException
- if an error occurs while starting the leader retrieval servicepublic void reconnect(JobID jobId)
jobId
- specifying the job for which to trigger reconnection@VisibleForTesting public boolean containsJob(JobID jobId)
jobId
- identifying the jobCopyright © 2014–2019 The Apache Software Foundation. All rights reserved.