Class DefaultResourceCleaner.Builder<T>
java.lang.Object
org.apache.flink.runtime.dispatcher.cleanup.DefaultResourceCleaner.Builder<T>
- Type Parameters:
T- The functional interface that's being translated into the internally usedDefaultResourceCleaner.CleanupFn.
- Enclosing class:
- DefaultResourceCleaner<T>
Builder for creating DefaultResourceCleaner instances.-
Method Summary
Modifier and TypeMethodDescriptionbuild()withPrioritizedCleanup(String label, T prioritizedCleanup) Prioritized cleanups run before their regular counterparts.withRegularCleanup(String label, T regularCleanup) Regular cleanups are resources for which the cleanup is triggered after all prioritized cleanups succeeded.
-
Method Details
-
withPrioritizedCleanup
Prioritized cleanups run before their regular counterparts. This method enables the caller to model dependencies between cleanup tasks. The order in which cleanable resources are added matters, i.e. if two cleanable resources are added as prioritized cleanup tasks, the resource being added first will block the cleanup of the second resource. All prioritized cleanup resources will run and finish before any resource that is added usingwithRegularCleanup(String, Object)is started.- Parameters:
label- The label being used when logging errors in the given cleanup.prioritizedCleanup- The cleanup callback that is going to be prioritized.
-
withRegularCleanup
Regular cleanups are resources for which the cleanup is triggered after all prioritized cleanups succeeded. All added regular cleanups will run concurrently to each other.- Parameters:
label- The label being used when logging errors in the given cleanup.regularCleanup- The cleanup callback that is going to run after all prioritized cleanups are finished.- See Also:
-
build
-