public class DefaultJobManagerRunnerRegistry extends Object implements JobManagerRunnerRegistry
DefaultJobManagerRunnerRegistry
is the default implementation of the JobManagerRunnerRegistry
interface.Constructor and Description |
---|
DefaultJobManagerRunnerRegistry(int initialCapacity) |
Modifier and Type | Method and Description |
---|---|
JobManagerRunner |
get(JobID jobId)
Returns the
JobManagerRunner for the given JobID . |
Collection<JobManagerRunner> |
getJobManagerRunners()
Returns the registered
JobManagerRunner instances. |
Set<JobID> |
getRunningJobIds()
Returns
JobID instances of registered JobManagerRunner instances. |
boolean |
isRegistered(JobID jobId)
Checks whether a
JobManagerRunner is registered under the given JobID . |
CompletableFuture<Void> |
localCleanupAsync(JobID jobId,
Executor unusedExecutor)
localCleanupAsync is expected to be called from the main thread. |
void |
register(JobManagerRunner jobManagerRunner)
Registers the given
JobManagerRunner instance. |
int |
size()
Returns the number of
JobManagerRunner instances currently being registered. |
JobManagerRunner |
unregister(JobID jobId)
Unregistered the
JobManagerRunner with the given JobID . |
public DefaultJobManagerRunnerRegistry(int initialCapacity)
public boolean isRegistered(JobID jobId)
JobManagerRunnerRegistry
JobManagerRunner
is registered under the given JobID
.isRegistered
in interface JobManagerRunnerRegistry
jobId
- The JobID
to check.true
, if a JobManagerRunner
is registered; false
otherwise.public void register(JobManagerRunner jobManagerRunner)
JobManagerRunnerRegistry
JobManagerRunner
instance.register
in interface JobManagerRunnerRegistry
public JobManagerRunner get(JobID jobId)
JobManagerRunnerRegistry
JobManagerRunner
for the given JobID
.get
in interface JobManagerRunnerRegistry
JobManagerRunnerRegistry.isRegistered(JobID)
public int size()
JobManagerRunnerRegistry
JobManagerRunner
instances currently being registered.size
in interface JobManagerRunnerRegistry
public Set<JobID> getRunningJobIds()
JobManagerRunnerRegistry
JobID
instances of registered JobManagerRunner
instances.getRunningJobIds
in interface JobManagerRunnerRegistry
public Collection<JobManagerRunner> getJobManagerRunners()
JobManagerRunnerRegistry
JobManagerRunner
instances.getJobManagerRunners
in interface JobManagerRunnerRegistry
public CompletableFuture<Void> localCleanupAsync(JobID jobId, Executor unusedExecutor)
LocallyCleanableResource
localCleanupAsync
is expected to be called from the main thread. Heavy IO tasks
should be outsourced into the passed cleanupExecutor
. Thread-safety must be ensured.localCleanupAsync
in interface LocallyCleanableResource
jobId
- The JobID
of the job for which the local data should be cleaned up.unusedExecutor
- The fallback executor for IO-heavy operations.public JobManagerRunner unregister(JobID jobId)
JobManagerRunnerRegistry
JobManagerRunner
with the given JobID
. null
is
returned if there's no JobManagerRunner
registered for the given JobID
.unregister
in interface JobManagerRunnerRegistry
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.