Class DefaultJobTable

java.lang.Object
org.apache.flink.runtime.taskexecutor.DefaultJobTable
All Implemented Interfaces:
AutoCloseable, JobTable

public final class DefaultJobTable extends Object implements JobTable
Default implementation of the JobTable.
  • Method Details

    • getOrCreateJob

      public <E extends Exception> JobTable.Job getOrCreateJob(org.apache.flink.api.common.JobID jobId, org.apache.flink.util.function.SupplierWithException<? extends JobTable.JobServices,E> jobServicesSupplier) throws E
      Description copied from interface: JobTable
      Gets a registered JobTable.Job or creates one if not present.
      Specified by:
      getOrCreateJob in interface JobTable
      Parameters:
      jobId - jobId identifies the job to get
      jobServicesSupplier - jobServicesSupplier create new JobTable.JobServices if a new job needs to be created
      Returns:
      the current job (existing or created) registered under jobId
      Throws:
      E - if the job services could not be created
    • getJob

      public Optional<JobTable.Job> getJob(org.apache.flink.api.common.JobID jobId)
      Description copied from interface: JobTable
      Gets the job registered under jobId.
      Specified by:
      getJob in interface JobTable
      Parameters:
      jobId - jobId identifying the job to get
      Returns:
      an Optional containing the JobTable.Job registered under jobId, or an empty Optional if no job has been registered
    • getConnection

      public Optional<JobTable.Connection> getConnection(org.apache.flink.api.common.JobID jobId)
      Description copied from interface: JobTable
      Gets the connection registered under jobId.
      Specified by:
      getConnection in interface JobTable
      Parameters:
      jobId - jobId identifying the connection to get
      Returns:
      an Optional containing the JobTable.Connection registered under jobId, or an empty Optional if no connection has been registered (this could also mean that a job which has not been connected exists)
    • getConnection

      public Optional<JobTable.Connection> getConnection(ResourceID resourceId)
      Description copied from interface: JobTable
      Gets the connection registered under resourceId.
      Specified by:
      getConnection in interface JobTable
      Parameters:
      resourceId - resourceId identifying the connection to get
      Returns:
      an Optional containing the JobTable.Connection registered under resourceId, or an empty Optional if no connection has been registered
    • getJobs

      public Collection<JobTable.Job> getJobs()
      Description copied from interface: JobTable
      Gets all registered jobs.
      Specified by:
      getJobs in interface JobTable
      Returns:
      collection of registered jobs
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: JobTable
      Returns true if the job table does not contain any jobs.
      Specified by:
      isEmpty in interface JobTable
      Returns:
      true if the job table does not contain any jobs, otherwise false
    • create

      public static DefaultJobTable create()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable