public class DefaultJobLeaderIdService extends Object implements JobLeaderIdService
getLeaderId(JobID). The future will only be completed with an exception in case the service
will be stopped.| 构造器和说明 |
|---|
DefaultJobLeaderIdService(HighAvailabilityServices highAvailabilityServices,
org.apache.flink.util.concurrent.ScheduledExecutor scheduledExecutor,
org.apache.flink.api.common.time.Time jobTimeout) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addJob(org.apache.flink.api.common.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(org.apache.flink.api.common.JobID jobId)
Check whether the given job is being monitored or not.
|
CompletableFuture<JobMasterId> |
getLeaderId(org.apache.flink.api.common.JobID jobId)
Get the leader's
JobMasterId future for the given job. |
boolean |
isStarted()
Checks whether the service has been started.
|
boolean |
isValidTimeout(org.apache.flink.api.common.JobID jobId,
UUID timeoutId)
Checks whether the given timeoutId for the given jobId is valid or not.
|
void |
removeJob(org.apache.flink.api.common.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 DefaultJobLeaderIdService(HighAvailabilityServices highAvailabilityServices, org.apache.flink.util.concurrent.ScheduledExecutor scheduledExecutor, org.apache.flink.api.common.time.Time jobTimeout)
public void start(JobLeaderIdActions initialJobLeaderIdActions) throws Exception
JobLeaderIdServicestart 在接口中 JobLeaderIdServiceinitialJobLeaderIdActions - to use for job leader id actionsException - which is thrown when clearing up old statepublic void stop()
throws Exception
JobLeaderIdServicestop 在接口中 JobLeaderIdServiceException - which is thrown in case a retrieval service cannot be stopped properlypublic boolean isStarted()
public void clear()
throws Exception
JobLeaderIdServiceclear 在接口中 JobLeaderIdServiceException - which is thrown in case a retrieval service cannot be stopped properlypublic void addJob(org.apache.flink.api.common.JobID jobId)
throws Exception
JobLeaderIdServiceaddJob 在接口中 JobLeaderIdServicejobId - identifying the job to monitorException - if the job could not be added to the servicepublic void removeJob(org.apache.flink.api.common.JobID jobId)
throws Exception
JobLeaderIdServiceremoveJob 在接口中 JobLeaderIdServicejobId - identifying the job to remove from monitorException - if removing the job failspublic boolean containsJob(org.apache.flink.api.common.JobID jobId)
JobLeaderIdServicecontainsJob 在接口中 JobLeaderIdServicejobId - identifying the jobpublic CompletableFuture<JobMasterId> getLeaderId(org.apache.flink.api.common.JobID jobId) throws Exception
JobLeaderIdServiceJobMasterId future for the given job.getLeaderId 在接口中 JobLeaderIdServicejobId - jobId specifying for which job to retrieve the JobMasterIdJobMasterIdException - if retrieving the JobMasterId cannot be startedpublic boolean isValidTimeout(org.apache.flink.api.common.JobID jobId,
UUID timeoutId)
JobLeaderIdServiceisValidTimeout 在接口中 JobLeaderIdServicejobId - 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 falseCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.