Class DefaultJobManagerRunnerRegistry
- java.lang.Object
-
- org.apache.flink.runtime.dispatcher.DefaultJobManagerRunnerRegistry
-
- All Implemented Interfaces:
LocallyCleanableResource
,JobManagerRunnerRegistry
public class DefaultJobManagerRunnerRegistry extends Object implements JobManagerRunnerRegistry
DefaultJobManagerRunnerRegistry
is the default implementation of theJobManagerRunnerRegistry
interface.
-
-
Constructor Summary
Constructors Constructor Description DefaultJobManagerRunnerRegistry(int initialCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JobManagerRunner
get(JobID jobId)
Returns theJobManagerRunner
for the givenJobID
.Collection<JobManagerRunner>
getJobManagerRunners()
Returns the registeredJobManagerRunner
instances.Set<JobID>
getRunningJobIds()
ReturnsJobID
instances of registeredJobManagerRunner
instances.boolean
isRegistered(JobID jobId)
Checks whether aJobManagerRunner
is registered under the givenJobID
.CompletableFuture<Void>
localCleanupAsync(JobID jobId, Executor unusedExecutor)
localCleanupAsync
is expected to be called from the main thread.void
register(JobManagerRunner jobManagerRunner)
Registers the givenJobManagerRunner
instance.int
size()
Returns the number ofJobManagerRunner
instances currently being registered.JobManagerRunner
unregister(JobID jobId)
Unregistered theJobManagerRunner
with the givenJobID
.
-
-
-
Method Detail
-
isRegistered
public boolean isRegistered(JobID jobId)
Description copied from interface:JobManagerRunnerRegistry
Checks whether aJobManagerRunner
is registered under the givenJobID
.- Specified by:
isRegistered
in interfaceJobManagerRunnerRegistry
- Parameters:
jobId
- TheJobID
to check.- Returns:
true
, if aJobManagerRunner
is registered;false
otherwise.
-
register
public void register(JobManagerRunner jobManagerRunner)
Description copied from interface:JobManagerRunnerRegistry
Registers the givenJobManagerRunner
instance.- Specified by:
register
in interfaceJobManagerRunnerRegistry
-
get
public JobManagerRunner get(JobID jobId)
Description copied from interface:JobManagerRunnerRegistry
Returns theJobManagerRunner
for the givenJobID
.- Specified by:
get
in interfaceJobManagerRunnerRegistry
- See Also:
JobManagerRunnerRegistry.isRegistered(JobID)
-
size
public int size()
Description copied from interface:JobManagerRunnerRegistry
Returns the number ofJobManagerRunner
instances currently being registered.- Specified by:
size
in interfaceJobManagerRunnerRegistry
-
getRunningJobIds
public Set<JobID> getRunningJobIds()
Description copied from interface:JobManagerRunnerRegistry
ReturnsJobID
instances of registeredJobManagerRunner
instances.- Specified by:
getRunningJobIds
in interfaceJobManagerRunnerRegistry
-
getJobManagerRunners
public Collection<JobManagerRunner> getJobManagerRunners()
Description copied from interface:JobManagerRunnerRegistry
Returns the registeredJobManagerRunner
instances.- Specified by:
getJobManagerRunners
in interfaceJobManagerRunnerRegistry
-
localCleanupAsync
public CompletableFuture<Void> localCleanupAsync(JobID jobId, Executor unusedExecutor)
Description copied from interface:LocallyCleanableResource
localCleanupAsync
is expected to be called from the main thread. Heavy IO tasks should be outsourced into the passedcleanupExecutor
. Thread-safety must be ensured.- Specified by:
localCleanupAsync
in interfaceLocallyCleanableResource
- Parameters:
jobId
- TheJobID
of the job for which the local data should be cleaned up.unusedExecutor
- The fallback executor for IO-heavy operations.- Returns:
- The cleanup result future.
-
unregister
public JobManagerRunner unregister(JobID jobId)
Description copied from interface:JobManagerRunnerRegistry
Unregistered theJobManagerRunner
with the givenJobID
.null
is returned if there's noJobManagerRunner
registered for the givenJobID
.- Specified by:
unregister
in interfaceJobManagerRunnerRegistry
-
-