Class QueueResizingEsThreadPoolExecutor
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor
org.elasticsearch.common.util.concurrent.QueueResizingEsThreadPoolExecutor
- All Implemented Interfaces:
Executor,ExecutorService
An extension to thread pool executor, which automatically adjusts the queue size of the
ResizableBlockingQueue according to Little's Law.-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor
EsThreadPoolExecutor.ShutdownListenerNested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterExecute(Runnable r, Throwable t)protected voidAppend details about this thread pool to the specifiedStringBuilder.intReturns the current queue size (operations that are queued)doubleReturns the exponentially weighted moving average of the task execution timeprotected Runnableprotected RunnablewrapRunnable(Runnable command)Methods inherited from class org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor
execute, getTasks, terminated, toStringMethods inherited from class java.util.concurrent.ThreadPoolExecutor
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, 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, shutdownNowMethods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
-
Field Details
-
EWMA_ALPHA
public static double EWMA_ALPHA
-
-
Method Details
-
wrapRunnable
- Overrides:
wrapRunnablein classEsThreadPoolExecutor
-
unwrap
- Overrides:
unwrapin classEsThreadPoolExecutor
-
getTaskExecutionEWMA
public double getTaskExecutionEWMA()Returns the exponentially weighted moving average of the task execution time -
getCurrentQueueSize
public int getCurrentQueueSize()Returns the current queue size (operations that are queued) -
afterExecute
- Overrides:
afterExecutein classEsThreadPoolExecutor
-
appendThreadPoolExecutorDetails
Description copied from class:EsThreadPoolExecutorAppend details about this thread pool to the specifiedStringBuilder. All details should be appended as key/value pairs in the form "%s = %s, "- Overrides:
appendThreadPoolExecutorDetailsin classEsThreadPoolExecutor- Parameters:
sb- theStringBuilderto append to
-