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 theJobTable.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.taskexecutor.JobTable
JobTable.Connection, JobTable.Job, JobTable.JobServices
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()static DefaultJobTablecreate()Optional<JobTable.Connection>getConnection(org.apache.flink.api.common.JobID jobId)Gets the connection registered under jobId.Optional<JobTable.Connection>getConnection(ResourceID resourceId)Gets the connection registered under resourceId.Optional<JobTable.Job>getJob(org.apache.flink.api.common.JobID jobId)Gets the job registered under jobId.Collection<JobTable.Job>getJobs()Gets all registered jobs.<E extends Exception>
JobTable.JobgetOrCreateJob(org.apache.flink.api.common.JobID jobId, org.apache.flink.util.function.SupplierWithException<? extends JobTable.JobServices,E> jobServicesSupplier)Gets a registeredJobTable.Jobor creates one if not present.booleanisEmpty()Returnstrueif the job table does not contain any jobs.
-
-
-
Method Detail
-
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 extends Exception
Description copied from interface:JobTableGets a registeredJobTable.Jobor creates one if not present.- Specified by:
getOrCreateJobin interfaceJobTable- Parameters:
jobId- jobId identifies the job to getjobServicesSupplier- jobServicesSupplier create newJobTable.JobServicesif 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 createdE extends Exception
-
getJob
public Optional<JobTable.Job> getJob(org.apache.flink.api.common.JobID jobId)
Description copied from interface:JobTableGets the job registered under jobId.- Specified by:
getJobin interfaceJobTable- Parameters:
jobId- jobId identifying the job to get- Returns:
- an
Optionalcontaining theJobTable.Jobregistered under jobId, or an emptyOptionalif no job has been registered
-
getConnection
public Optional<JobTable.Connection> getConnection(org.apache.flink.api.common.JobID jobId)
Description copied from interface:JobTableGets the connection registered under jobId.- Specified by:
getConnectionin interfaceJobTable- Parameters:
jobId- jobId identifying the connection to get- Returns:
- an
Optionalcontaining theJobTable.Connectionregistered under jobId, or an emptyOptionalif 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:JobTableGets the connection registered under resourceId.- Specified by:
getConnectionin interfaceJobTable- Parameters:
resourceId- resourceId identifying the connection to get- Returns:
- an
Optionalcontaining theJobTable.Connectionregistered under resourceId, or an emptyOptionalif no connection has been registered
-
getJobs
public Collection<JobTable.Job> getJobs()
Description copied from interface:JobTableGets all registered jobs.
-
isEmpty
public boolean isEmpty()
Description copied from interface:JobTableReturnstrueif the job table does not contain any jobs.
-
create
public static DefaultJobTable create()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
-