Autopsy  4.19.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
Classes | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
org.sleuthkit.autopsy.threadutils.TaskRetryUtil Class Reference

Classes

class  TaskAttempt
 
interface  Terminator
 

Static Public Member Functions

static< T > T attemptTask (Callable< T > task, List< TaskAttempt > attempts, ScheduledThreadPoolExecutor executor, Terminator terminator, Logger logger, String taskDesc) throws InterruptedException
 
static long getTotalFailedTasksCount ()
 
static long getTotalTaskAttemptTimeOutsCount ()
 
static long getTotalTaskRetriesCount ()
 
static long getTotalTasksCount ()
 

Private Member Functions

 TaskRetryUtil ()
 

Static Private Attributes

static final AtomicLong totalFailedTasks = new AtomicLong()
 
static final AtomicLong totalTaskAttemptTimeOuts = new AtomicLong()
 
static final AtomicLong totalTaskRetries = new AtomicLong()
 
static final AtomicLong totalTasks = new AtomicLong()
 

Detailed Description

A utility that attempts a task a specified number of times with a specified delay before each attempt and an optional timeout for each attempt. If an attempt times out, the attempt will be cancelled and the next attempt, if any, will begin.

Definition at line 38 of file TaskRetryUtil.java.

Constructor & Destructor Documentation

org.sleuthkit.autopsy.threadutils.TaskRetryUtil.TaskRetryUtil ( )
private

Private contructor to prevent TaskRetryUtil object instantiation.

Definition at line 289 of file TaskRetryUtil.java.

Member Function Documentation

static <T> T org.sleuthkit.autopsy.threadutils.TaskRetryUtil.attemptTask ( Callable< T >  task,
List< TaskAttempt attempts,
ScheduledThreadPoolExecutor  executor,
Terminator  terminator,
Logger  logger,
String  taskDesc 
) throws InterruptedException
static

Attempts a task a specified number of times with a specified delay before each attempt and an optional timeout for each attempt. If an attempt times out, that particular attempt task will be cancelled.

Template Parameters
TThe return type of the task.
Parameters
taskThe task.
attemptsThe defining details for each attempt of the task.
executorThe scheduled task executor to be used to attempt the task.
terminatorA task terminator that can be used to stop the task attempts between attempts. Optional, may be null.
loggerA logger that will be used to log info messages about each task attempt and for error messages. Optional, may be null.
taskDescA description of the task for log messages. Optional, may be null.
Returns
The task result if the task was completed, null otherwise.
Exceptions
InterruptedException

Definition at line 183 of file TaskRetryUtil.java.

References org.sleuthkit.autopsy.threadutils.TaskRetryUtil.TaskAttempt.getDelay(), org.sleuthkit.autopsy.threadutils.TaskRetryUtil.TaskAttempt.getTimeout(), and org.sleuthkit.autopsy.threadutils.TaskRetryUtil.TaskAttempt.getTimeUnit().

static long org.sleuthkit.autopsy.threadutils.TaskRetryUtil.getTotalFailedTasksCount ( )
static

Returns a count of the total number of tasks submitted to this utility that were not able to be completed despite retry attempts.

Returns
The failed tasks count.

Definition at line 282 of file TaskRetryUtil.java.

Referenced by org.sleuthkit.autopsy.modules.embeddedfileextractor.EmbeddedFileExtractorIngestModule.shutDown().

static long org.sleuthkit.autopsy.threadutils.TaskRetryUtil.getTotalTaskAttemptTimeOutsCount ( )
static

Returns a count of the total number of task attempts that timed out.

Returns
The timed out task attempts count.

Definition at line 272 of file TaskRetryUtil.java.

Referenced by org.sleuthkit.autopsy.modules.embeddedfileextractor.EmbeddedFileExtractorIngestModule.shutDown().

static long org.sleuthkit.autopsy.threadutils.TaskRetryUtil.getTotalTaskRetriesCount ( )
static

Returns a count of the total number of task retry attempts.

Returns
The task retries count.

Definition at line 263 of file TaskRetryUtil.java.

Referenced by org.sleuthkit.autopsy.modules.embeddedfileextractor.EmbeddedFileExtractorIngestModule.shutDown().

static long org.sleuthkit.autopsy.threadutils.TaskRetryUtil.getTotalTasksCount ( )
static

Returns a count of the total number of tasks submitted to this utility.

Returns
The tasks count.

Definition at line 254 of file TaskRetryUtil.java.

Referenced by org.sleuthkit.autopsy.modules.embeddedfileextractor.EmbeddedFileExtractorIngestModule.shutDown().

Member Data Documentation

final AtomicLong org.sleuthkit.autopsy.threadutils.TaskRetryUtil.totalFailedTasks = new AtomicLong()
staticprivate

Definition at line 43 of file TaskRetryUtil.java.

final AtomicLong org.sleuthkit.autopsy.threadutils.TaskRetryUtil.totalTaskAttemptTimeOuts = new AtomicLong()
staticprivate

Definition at line 42 of file TaskRetryUtil.java.

final AtomicLong org.sleuthkit.autopsy.threadutils.TaskRetryUtil.totalTaskRetries = new AtomicLong()
staticprivate

Definition at line 41 of file TaskRetryUtil.java.

final AtomicLong org.sleuthkit.autopsy.threadutils.TaskRetryUtil.totalTasks = new AtomicLong()
staticprivate

Definition at line 40 of file TaskRetryUtil.java.


The documentation for this class was generated from the following file:

Copyright © 2012-2021 Basis Technology. Generated on: Fri Aug 6 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.