static class RegionServerFlushTableProcedureManager.FlushTableSubprocedurePool extends Object
ExecutorService
.
It uses a ExecutorCompletionService
which provides queuing of
completed tasks which lets us efficiently cancel pending tasks upon the earliest operation
failures.Modifier and Type | Field and Description |
---|---|
private Abortable |
abortable |
private ThreadPoolExecutor |
executor |
private List<Future<Void>> |
futures |
private String |
name |
private boolean |
stopped |
private ExecutorCompletionService<Void> |
taskPool |
Constructor and Description |
---|
RegionServerFlushTableProcedureManager.FlushTableSubprocedurePool(String name,
org.apache.hadoop.conf.Configuration conf,
Abortable abortable) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
cancelTasks()
This attempts to cancel out all pending and in progress tasks.
|
(package private) boolean |
hasTasks() |
(package private) void |
stop()
Gracefully shutdown the thread pool.
|
(package private) void |
submitTask(Callable<Void> task)
Submit a task to the pool.
|
(package private) boolean |
waitForOutstandingTasks()
Wait for all of the currently outstanding tasks submitted via
submitTask(Callable) . |
private final Abortable abortable
private final ExecutorCompletionService<Void> taskPool
private final ThreadPoolExecutor executor
private volatile boolean stopped
private final String name
boolean hasTasks()
void submitTask(Callable<Void> task)
waitForOutstandingTasks()
.boolean waitForOutstandingTasks() throws ForeignException, InterruptedException
submitTask(Callable)
.
This *must* be called after all tasks are submitted via submitTask.InterruptedException
ForeignException
void cancelTasks() throws InterruptedException
InterruptedException
void stop()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.