Package org.apache.hadoop.hbase.executor
Class ExecutorService.TrackingThreadPoolExecutor
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
org.apache.hadoop.hbase.executor.ExecutorService.TrackingThreadPoolExecutor
- All Implemented Interfaces:
Executor
,ExecutorService
- Enclosing class:
- ExecutorService
A subclass of ThreadPoolExecutor that keeps track of the Runnables that are executing at any
given point in time.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTrackingThreadPoolExecutor
(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
afterExecute
(Runnable r, Throwable t) protected void
beforeExecute
(Thread t, Runnable r) Methods inherited from class java.util.concurrent.ThreadPoolExecutor
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated, toString
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
-
Field Details
-
running
-
-
Constructor Details
-
TrackingThreadPoolExecutor
public TrackingThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue)
-
-
Method Details
-
afterExecute
- Overrides:
afterExecute
in classThreadPoolExecutor
-
beforeExecute
- Overrides:
beforeExecute
in classThreadPoolExecutor
-
getRunningTasks
- Returns:
- a map of the threads currently running tasks inside this executor. Each key is an active thread, and the value is the task that is currently running. Note that this is not a stable snapshot of the map.
-