Class RegionServerSnapshotManager.SnapshotSubprocedurePool
java.lang.Object
org.apache.hadoop.hbase.regionserver.snapshot.RegionServerSnapshotManager.SnapshotSubprocedurePool
- Enclosing class:
- RegionServerSnapshotManager
We use the SnapshotSubprocedurePool, a class specific thread pool instead of
ExecutorService
. It uses a
ExecutorCompletionService
which provides queuing of completed
tasks which lets us efficiently cancel pending tasks upon the earliest operation failures.
HBase's ExecutorService (different from ExecutorService
) isn't
really built for coordinated tasks where multiple threads as part of one larger task. In RS's
the HBase Executor services are only used for open and close and not other threadpooled
operations such as compactions and replication sinks.-
Field Summary
-
Constructor Summary
ConstructorDescriptionSnapshotSubprocedurePool
(String name, org.apache.hadoop.conf.Configuration conf, Abortable abortable) -
Method Summary
Modifier and TypeMethodDescription(package private) void
This attempts to cancel out all pending and in progress tasks (interruptions issues)(package private) boolean
hasTasks()
(package private) void
stop()
Abruptly shutdown the thread pool.(package private) void
submitTask
(Callable<Void> task) Submit a task to the pool.(package private) boolean
Wait for all of the currently outstanding tasks submitted viasubmitTask(Callable)
.
-
Field Details
-
abortable
-
taskPool
-
executor
-
stopped
-
futures
-
name
-
-
Constructor Details
-
SnapshotSubprocedurePool
SnapshotSubprocedurePool(String name, org.apache.hadoop.conf.Configuration conf, Abortable abortable)
-
-
Method Details
-
hasTasks
boolean hasTasks() -
submitTask
Submit a task to the pool. NOTE: all must be submitted before you can safelywaitForOutstandingTasks()
. This version does not support issuing tasks from multiple concurrent table snapshots requests. -
waitForOutstandingTasks
Wait for all of the currently outstanding tasks submitted viasubmitTask(Callable)
. This *must* be called after all tasks are submitted via submitTask.- Returns:
- true on success, false otherwise
- Throws:
SnapshotCreationException
- if the snapshot failed while we were waitingForeignException
InterruptedException
-
cancelTasks
This attempts to cancel out all pending and in progress tasks (interruptions issues)- Throws:
InterruptedException
-
stop
void stop()Abruptly shutdown the thread pool. Call when exiting a region server.
-