public interface JobLeaderIdService
getLeaderId(JobID)
. The future will only be completed with an exception in case the service
will be stopped.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)
Get the leader's
JobMasterId future for the given job. |
boolean |
isValidTimeout(JobID jobId,
UUID timeoutId)
Checks whether the given timeoutId for the given jobId is valid or not.
|
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.
|
void start(JobLeaderIdActions initialJobLeaderIdActions) throws Exception
initialJobLeaderIdActions
- to use for job leader id actionsException
- which is thrown when clearing up old statevoid stop() throws Exception
Exception
- which is thrown in case a retrieval service cannot be stopped properlyvoid clear() throws Exception
Exception
- which is thrown in case a retrieval service cannot be stopped properlyvoid addJob(JobID jobId) throws Exception
jobId
- identifying the job to monitorException
- if the job could not be added to the servicevoid removeJob(JobID jobId) throws Exception
jobId
- identifying the job to remove from monitorException
- if removing the job failsboolean containsJob(JobID jobId)
jobId
- identifying the jobCompletableFuture<JobMasterId> getLeaderId(JobID jobId) throws Exception
JobMasterId
future for the given job.jobId
- jobId specifying for which job to retrieve the JobMasterId
JobMasterId
Exception
- if retrieving the JobMasterId
cannot be startedboolean isValidTimeout(JobID jobId, UUID timeoutId)
jobId
- jobId identifying the job for which the timeout should be checkedtimeoutId
- timeoutId specifying the timeout which should be checked for its validitytrue
if the timeout is valid; otherwise false
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.