Package org.terracotta.utilities.io
Class Files.RetryingDeleteTask
- java.lang.Object
-
- java.util.concurrent.FutureTask<java.lang.Void>
-
- org.terracotta.utilities.io.Files.RetryingDeleteTask
-
- All Implemented Interfaces:
java.lang.Runnable,java.util.concurrent.Future<java.lang.Void>,java.util.concurrent.RunnableFuture<java.lang.Void>
- Enclosing class:
- Files
private static class Files.RetryingDeleteTask extends java.util.concurrent.FutureTask<java.lang.Void>Task to perform a background deletion. This task resubmits itself if the deletion, after retry, fails delete the file/directory.
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.file.PathdeletionPathprivate java.util.concurrent.ExecutorServiceexecutorprivate static intLOGGING_SUPPRESSION_FACTORprivate java.lang.RunnableprogressHelperprivate booleanretryDirNotEmptyprivate java.util.function.Predicate<java.nio.file.FileSystemException>shouldLogprivate java.util.concurrent.Callable<java.lang.Void>task
-
Constructor Summary
Constructors Modifier Constructor Description privateRetryingDeleteTask(java.util.concurrent.ExecutorService executor, java.util.concurrent.Callable<java.lang.Void> deletionTask, java.nio.file.Path deletionPath, boolean retryDirNotEmpty, java.lang.Runnable progressHelper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidlogFailedAttempt(java.nio.file.FileSystemException t)voidrun()
-
-
-
Field Detail
-
LOGGING_SUPPRESSION_FACTOR
private static final int LOGGING_SUPPRESSION_FACTOR
- See Also:
- Constant Field Values
-
executor
private final java.util.concurrent.ExecutorService executor
-
task
private final java.util.concurrent.Callable<java.lang.Void> task
-
deletionPath
private final java.nio.file.Path deletionPath
-
retryDirNotEmpty
private final boolean retryDirNotEmpty
-
progressHelper
private final java.lang.Runnable progressHelper
-
shouldLog
private final java.util.function.Predicate<java.nio.file.FileSystemException> shouldLog
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable- Specified by:
runin interfacejava.util.concurrent.RunnableFuture<java.lang.Void>- Overrides:
runin classjava.util.concurrent.FutureTask<java.lang.Void>
-
logFailedAttempt
private void logFailedAttempt(java.nio.file.FileSystemException t)
-
-