public class JobLeaderIdService extends Object
getLeaderId(JobID)
. The future will only be completed with an exception in case
the service will be stopped.Constructor and Description |
---|
JobLeaderIdService(HighAvailabilityServices highAvailabilityServices,
ScheduledExecutor scheduledExecutor,
Time jobTimeout) |
Modifier and Type | Method and Description |
---|---|
void |
addJob(JobID jobId)
Add a job to be monitored to retrieve the job leader id.
|
void |
clear()
Stop and clear the currently registered job leader id listeners.
|
boolean |
containsJob(JobID jobId)
Check whether the given job is being monitored or not.
|
CompletableFuture<JobMasterId> |
getLeaderId(JobID jobId) |
boolean |
isStarted()
Checks whether the service has been started.
|
boolean |
isValidTimeout(JobID jobId,
UUID timeoutId) |
void |
removeJob(JobID jobId)
Remove the given job from being monitored by the service.
|
void |
start(JobLeaderIdActions initialJobLeaderIdActions)
Start the service with the given job leader actions.
|
void |
stop()
Stop the service.
|
public JobLeaderIdService(HighAvailabilityServices highAvailabilityServices, ScheduledExecutor scheduledExecutor, Time jobTimeout) throws Exception
Exception
public void start(JobLeaderIdActions initialJobLeaderIdActions) throws Exception
initialJobLeaderIdActions
- to use for job leader id actionsException
- which is thrown when clearing up old statepublic void stop() throws Exception
Exception
- which is thrown in case a retrieval service cannot be stopped properlypublic boolean isStarted()
public void clear() throws Exception
Exception
- which is thrown in case a retrieval service cannot be stopped properlypublic void addJob(JobID jobId) throws Exception
jobId
- identifying the job to monitorException
- if the job could not be added to the servicepublic void removeJob(JobID jobId) throws Exception
jobId
- identifying the job to remove from monitorException
- if removing the job failspublic boolean containsJob(JobID jobId)
jobId
- identifying the jobpublic CompletableFuture<JobMasterId> getLeaderId(JobID jobId) throws Exception
Exception
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.