Class DefaultJobLeaderService

java.lang.Object
org.apache.flink.runtime.taskexecutor.DefaultJobLeaderService
All Implemented Interfaces:
JobLeaderService

public class DefaultJobLeaderService extends Object implements JobLeaderService
Default implementation of JobLeaderService.
  • Constructor Details

  • Method Details

    • start

      public void start(String initialOwnerAddress, org.apache.flink.runtime.rpc.RpcService initialRpcService, HighAvailabilityServices initialHighAvailabilityServices, JobLeaderListener initialJobLeaderListener)
      Description copied from interface: JobLeaderService
      Start the job leader service with the given services.
      Specified by:
      start in interface JobLeaderService
      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

      public void stop() throws Exception
      Description copied from interface: JobLeaderService
      Stop the job leader services. This implies stopping all leader retrieval services for the different jobs and their leader retrieval listeners.
      Specified by:
      stop in interface JobLeaderService
      Throws:
      Exception - if an error occurs while stopping the service
    • removeJob

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

      public void addJob(org.apache.flink.api.common.JobID jobId, String defaultTargetAddress) throws Exception
      Description copied from interface: JobLeaderService
      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.
      Specified by:
      addJob in interface JobLeaderService
      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

      public void reconnect(org.apache.flink.api.common.JobID jobId)
      Description copied from interface: JobLeaderService
      Triggers reconnection to the last known leader of the given job.
      Specified by:
      reconnect in interface JobLeaderService
      Parameters:
      jobId - specifying the job for which to trigger reconnection
    • containsJob

      @VisibleForTesting public boolean containsJob(org.apache.flink.api.common.JobID jobId)
      Check whether the service monitors the given job.
      Specified by:
      containsJob in interface JobLeaderService
      Parameters:
      jobId - identifying the job
      Returns:
      True if the given job is monitored; otherwise false