public class DefaultJobLeaderService extends Object implements JobLeaderService
JobLeaderService
.Constructor and Description |
---|
DefaultJobLeaderService(UnresolvedTaskManagerLocation location,
RetryingRegistrationConfiguration retryingRegistrationConfiguration) |
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 DefaultJobLeaderService(UnresolvedTaskManagerLocation location, RetryingRegistrationConfiguration retryingRegistrationConfiguration)
public void start(String initialOwnerAddress, RpcService initialRpcService, HighAvailabilityServices initialHighAvailabilityServices, JobLeaderListener initialJobLeaderListener)
JobLeaderService
start
in interface JobLeaderService
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
JobLeaderService
stop
in interface JobLeaderService
Exception
- if an error occurs while stopping the servicepublic void removeJob(JobID jobId)
JobLeaderService
removeJob
in interface JobLeaderService
jobId
- identifying the job to remove from monitoringpublic void addJob(JobID jobId, String defaultTargetAddress) throws Exception
JobLeaderService
addJob
in interface JobLeaderService
jobId
- identifying the job to monitordefaultTargetAddress
- of the job leaderException
- if an error occurs while starting the leader retrieval servicepublic void reconnect(JobID jobId)
JobLeaderService
reconnect
in interface JobLeaderService
jobId
- specifying the job for which to trigger reconnection@VisibleForTesting public boolean containsJob(JobID jobId)
containsJob
in interface JobLeaderService
jobId
- identifying the jobCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.