Interface JobLeaderIdService

All Known Implementing Classes:
DefaultJobLeaderIdService

public interface JobLeaderIdService
Service which retrieves for a registered job the current job leader id (the leader id of the job manager responsible for the job). The leader id will be exposed as a future via the getLeaderId(JobID). The future will only be completed with an exception in case the service will be stopped.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addJob(org.apache.flink.api.common.JobID jobId)
    Add a job to be monitored to retrieve the job leader id.
    void
    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.
    getLeaderId(org.apache.flink.api.common.JobID jobId)
    Get the leader's JobMasterId future for the given job.
    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 the service.
  • Method Details

    • start

      void start(JobLeaderIdActions initialJobLeaderIdActions) throws Exception
      Start the service with the given job leader actions.
      Parameters:
      initialJobLeaderIdActions - to use for job leader id actions
      Throws:
      Exception - which is thrown when clearing up old state
    • stop

      void stop() throws Exception
      Stop the service.
      Throws:
      Exception - which is thrown in case a retrieval service cannot be stopped properly
    • clear

      void clear() throws Exception
      Stop and clear the currently registered job leader id listeners.
      Throws:
      Exception - which is thrown in case a retrieval service cannot be stopped properly
    • addJob

      void addJob(org.apache.flink.api.common.JobID jobId) throws Exception
      Add a job to be monitored to retrieve the job leader id.
      Parameters:
      jobId - identifying the job to monitor
      Throws:
      Exception - if the job could not be added to the service
    • removeJob

      void removeJob(org.apache.flink.api.common.JobID jobId) throws Exception
      Remove the given job from being monitored by the service.
      Parameters:
      jobId - identifying the job to remove from monitor
      Throws:
      Exception - if removing the job fails
    • containsJob

      boolean containsJob(org.apache.flink.api.common.JobID jobId)
      Check whether the given job is being monitored or not.
      Parameters:
      jobId - identifying the job
      Returns:
      True if the job is being monitored; otherwise false
    • getLeaderId

      CompletableFuture<JobMasterId> getLeaderId(org.apache.flink.api.common.JobID jobId) throws Exception
      Get the leader's JobMasterId future for the given job.
      Parameters:
      jobId - jobId specifying for which job to retrieve the JobMasterId
      Returns:
      Future with the current leader's JobMasterId
      Throws:
      Exception - if retrieving the JobMasterId cannot be started
    • isValidTimeout

      boolean isValidTimeout(org.apache.flink.api.common.JobID jobId, UUID timeoutId)
      Checks whether the given timeoutId for the given jobId is valid or not.
      Parameters:
      jobId - jobId identifying the job for which the timeout should be checked
      timeoutId - timeoutId specifying the timeout which should be checked for its validity
      Returns:
      true if the timeout is valid; otherwise false