Class DispatcherResourceCleanerFactory
- java.lang.Object
-
- org.apache.flink.runtime.dispatcher.cleanup.DispatcherResourceCleanerFactory
-
- All Implemented Interfaces:
ResourceCleanerFactory
public class DispatcherResourceCleanerFactory extends Object implements ResourceCleanerFactory
DispatcherResourceCleanerFactoryinstantiatesResourceCleanerinstances that clean cleanable resources from theDispatcher.We need to handle the
JobManagerRunnerRegistrydifferently due to a dependency between closing theJobManagerRunnerand theHighAvailabilityServices. This is fixed inFLINK-24038using a feature flag to enable/disable single leader election for all theJobManagercomponents. We can remove the priority cleanup logic after removing the per-component leader election.
-
-
Constructor Summary
Constructors Constructor Description DispatcherResourceCleanerFactory(Executor cleanupExecutor, org.apache.flink.util.concurrent.RetryStrategy retryStrategy, JobManagerRunnerRegistry jobManagerRunnerRegistry, ExecutionPlanWriter executionPlanWriter, BlobServer blobServer, HighAvailabilityServices highAvailabilityServices, JobManagerMetricGroup jobManagerMetricGroup)DispatcherResourceCleanerFactory(JobManagerRunnerRegistry jobManagerRunnerRegistry, DispatcherServices dispatcherServices)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceCleanercreateGlobalResourceCleaner(org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor mainThreadExecutor)CreatesResourceCleanerthat initiatesGloballyCleanableResource.globalCleanupAsync(JobID, Executor)calls.ResourceCleanercreateLocalResourceCleaner(org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor mainThreadExecutor)CreatesResourceCleanerthat initiatesLocallyCleanableResource.localCleanupAsync(JobID, Executor)calls.
-
-
-
Constructor Detail
-
DispatcherResourceCleanerFactory
public DispatcherResourceCleanerFactory(JobManagerRunnerRegistry jobManagerRunnerRegistry, DispatcherServices dispatcherServices)
-
DispatcherResourceCleanerFactory
@VisibleForTesting public DispatcherResourceCleanerFactory(Executor cleanupExecutor, org.apache.flink.util.concurrent.RetryStrategy retryStrategy, JobManagerRunnerRegistry jobManagerRunnerRegistry, ExecutionPlanWriter executionPlanWriter, BlobServer blobServer, HighAvailabilityServices highAvailabilityServices, JobManagerMetricGroup jobManagerMetricGroup)
-
-
Method Detail
-
createLocalResourceCleaner
public ResourceCleaner createLocalResourceCleaner(org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor mainThreadExecutor)
Description copied from interface:ResourceCleanerFactoryCreatesResourceCleanerthat initiatesLocallyCleanableResource.localCleanupAsync(JobID, Executor)calls.- Specified by:
createLocalResourceCleanerin interfaceResourceCleanerFactory- Parameters:
mainThreadExecutor- Used for validating that theLocallyCleanableResource.localCleanupAsync(JobID, Executor)is called from the main thread.
-
createGlobalResourceCleaner
public ResourceCleaner createGlobalResourceCleaner(org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor mainThreadExecutor)
Description copied from interface:ResourceCleanerFactoryCreatesResourceCleanerthat initiatesGloballyCleanableResource.globalCleanupAsync(JobID, Executor)calls.- Specified by:
createGlobalResourceCleanerin interfaceResourceCleanerFactory- Parameters:
mainThreadExecutor- Used for validating that theGloballyCleanableResource.globalCleanupAsync(JobID, Executor)is called from the main thread.
-
-