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>
public static class DefaultResourceCleaner.Builder<T> extends Object
Builder
for creatingDefaultResourceCleaner
instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultResourceCleaner<T>
build()
DefaultResourceCleaner.Builder<T>
withPrioritizedCleanup(String label, T prioritizedCleanup)
Prioritized cleanups run before their regular counterparts.DefaultResourceCleaner.Builder<T>
withRegularCleanup(String label, T regularCleanup)
Regular cleanups are resources for which the cleanup is triggered after all prioritized cleanups succeeded.
-
-
-
Method Detail
-
withPrioritizedCleanup
public DefaultResourceCleaner.Builder<T> withPrioritizedCleanup(String label, T prioritizedCleanup)
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
public DefaultResourceCleaner.Builder<T> withRegularCleanup(String label, T regularCleanup)
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:
withPrioritizedCleanup(String, Object)
-
build
public DefaultResourceCleaner<T> build()
-
-