Interface JobLeaderService

All Known Implementing Classes:
DefaultJobLeaderService

public interface JobLeaderService
This service has the responsibility to monitor the job leaders (the job manager which is leader for a given job) for all registered jobs. Upon gaining leadership for a job and detection by the job leader service, the service tries to establish a connection to the job leader. After successfully establishing a connection, the job leader listener is notified about the new job leader and its connection. In case that a job leader loses leadership, the job leader listener is notified as well.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addJob(org.apache.flink.api.common.JobID jobId, String defaultTargetAddress)
    Add the given job to be monitored.
    boolean
    containsJob(org.apache.flink.api.common.JobID jobId)
    Check whether the service monitors the given job.
    void
    reconnect(org.apache.flink.api.common.JobID jobId)
    Triggers reconnection to the last known leader of the given job.
    void
    removeJob(org.apache.flink.api.common.JobID jobId)
    Remove the given job from being monitored by the job leader service.
    void
    start(String initialOwnerAddress, org.apache.flink.runtime.rpc.RpcService initialRpcService, HighAvailabilityServices initialHighAvailabilityServices, JobLeaderListener initialJobLeaderListener)
    Start the job leader service with the given services.
    void
    Stop the job leader services.
  • Method Details

    • start

      void start(String initialOwnerAddress, org.apache.flink.runtime.rpc.RpcService initialRpcService, HighAvailabilityServices initialHighAvailabilityServices, JobLeaderListener initialJobLeaderListener)
      Start the job leader service with the given services.
      Parameters:
      initialOwnerAddress - to be used for establishing connections (source address)
      initialRpcService - to be used to create rpc connections
      initialHighAvailabilityServices - to create leader retrieval services for the different jobs
      initialJobLeaderListener - listening for job leader changes
    • stop

      void stop() throws Exception
      Stop the job leader services. This implies stopping all leader retrieval services for the different jobs and their leader retrieval listeners.
      Throws:
      Exception - if an error occurs while stopping the service
    • removeJob

      void removeJob(org.apache.flink.api.common.JobID jobId)
      Remove the given job from being monitored by the job leader service.
      Parameters:
      jobId - identifying the job to remove from monitoring
    • addJob

      void addJob(org.apache.flink.api.common.JobID jobId, String defaultTargetAddress) throws Exception
      Add the given job to be monitored. This means that the service tries to detect leaders for this job and then tries to establish a connection to it.
      Parameters:
      jobId - identifying the job to monitor
      defaultTargetAddress - of the job leader
      Throws:
      Exception - if an error occurs while starting the leader retrieval service
    • reconnect

      void reconnect(org.apache.flink.api.common.JobID jobId)
      Triggers reconnection to the last known leader of the given job.
      Parameters:
      jobId - specifying the job for which to trigger reconnection
    • containsJob

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