V - The time value that will be returned when the task is executed.public abstract class TimedCallable<V> extends Object implements Callable<V>
TODO: look at switching to fork join.
| Constructor and Description |
|---|
TimedCallable() |
| Modifier and Type | Method and Description |
|---|---|
V |
call() |
static <V> List<V> |
run(String activity,
org.slf4j.Logger logger,
List<TimedCallable<V>> tasks,
int parallelism)
Execute the list of runnables with the given parallelization.
|
protected abstract V |
runInner() |
public static <V> List<V> run(String activity, org.slf4j.Logger logger, List<TimedCallable<V>> tasks, int parallelism) throws IOException
UserException is thrown.activity - Name of activity for reporting in logger.logger - The logger to use to report results.tasks - List of callable that should be executed and timed. If this list has one item, task will be
completed in-thread. Each callable must handle InterruptedExceptions.parallelism - The number of threads that should be run to complete this task.IOException - All exceptions are coerced to IOException since this was build for storage system tasks initially.Copyright © 2021 The Apache Software Foundation. All rights reserved.