Package org.apache.hadoop.hbase
Class JitterScheduledThreadPoolExecutorImpl
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
java.util.concurrent.ScheduledThreadPoolExecutor
org.apache.hadoop.hbase.JitterScheduledThreadPoolExecutorImpl
- All Implemented Interfaces:
Executor
,ExecutorService
,ScheduledExecutorService
ScheduledThreadPoolExecutor that will add some jitter to the RunnableScheduledFuture.getDelay.
This will spread out things on a distributed cluster.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
Class that basically just defers to the wrapped future.Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
-
Field Summary
-
Constructor Summary
ConstructorDescriptionJitterScheduledThreadPoolExecutorImpl
(int corePoolSize, ThreadFactory threadFactory, double spread) Main constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected <V> RunnableScheduledFuture<V>
decorateTask
(Runnable runnable, RunnableScheduledFuture<V> task) protected <V> RunnableScheduledFuture<V>
decorateTask
(Callable<V> callable, RunnableScheduledFuture<V> task) Methods inherited from class java.util.concurrent.ScheduledThreadPoolExecutor
execute, getContinueExistingPeriodicTasksAfterShutdownPolicy, getExecuteExistingDelayedTasksAfterShutdownPolicy, getQueue, getRemoveOnCancelPolicy, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, setContinueExistingPeriodicTasksAfterShutdownPolicy, setExecuteExistingDelayedTasksAfterShutdownPolicy, setRemoveOnCancelPolicy, shutdown, shutdownNow, submit, submit, submit
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, terminated, toString
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated
-
Field Details
-
spread
-
-
Constructor Details
-
JitterScheduledThreadPoolExecutorImpl
public JitterScheduledThreadPoolExecutorImpl(int corePoolSize, ThreadFactory threadFactory, double spread) Main constructor.- Parameters:
spread
- The percent up and down that RunnableScheduledFuture.getDelay should be jittered.
-
-
Method Details
-
decorateTask
protected <V> RunnableScheduledFuture<V> decorateTask(Runnable runnable, RunnableScheduledFuture<V> task) - Overrides:
decorateTask
in classScheduledThreadPoolExecutor
-
decorateTask
protected <V> RunnableScheduledFuture<V> decorateTask(Callable<V> callable, RunnableScheduledFuture<V> task) - Overrides:
decorateTask
in classScheduledThreadPoolExecutor
-