Module org.elasticsearch.server
Class EsThreadPoolExecutor
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor
- All Implemented Interfaces:
AutoCloseable,Executor,ExecutorService
- Direct Known Subclasses:
PrioritizedEsThreadPoolExecutor,TaskExecutionTimeTrackingEsThreadPoolExecutor
An extension to thread pool executor, allowing (in the future) to add specific additional stats to it.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterExecute(Runnable r, Throwable t) protected voidAppend details about this thread pool to the specifiedStringBuilder.voidgetTasks()Returns a stream of all pending tasks.booleanvoidsetCorePoolSize(int corePoolSize) voidsetMaximumPoolSize(int maximumPoolSize) final StringtoString()protected Runnableprotected RunnablewrapRunnable(Runnable command) Methods 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, setKeepAliveTime, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminatedMethods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submitMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.concurrent.ExecutorService
close
-
Method Details
-
setCorePoolSize
public void setCorePoolSize(int corePoolSize) - Overrides:
setCorePoolSizein classThreadPoolExecutor
-
setMaximumPoolSize
public void setMaximumPoolSize(int maximumPoolSize) - Overrides:
setMaximumPoolSizein classThreadPoolExecutor
-
execute
- Specified by:
executein interfaceExecutor- Overrides:
executein classThreadPoolExecutor
-
afterExecute
- Overrides:
afterExecutein classThreadPoolExecutor
-
getTasks
Returns a stream of all pending tasks. This is similar toThreadPoolExecutor.getQueue()but will expose the originally submittedRunnableinstances rather than potentially wrapped ones. -
toString
- Overrides:
toStringin classThreadPoolExecutor
-
remove
- Overrides:
removein classThreadPoolExecutor
-
appendThreadPoolExecutorDetails
Append details about this thread pool to the specifiedStringBuilder. All details should be appended as key/value pairs in the form "%s = %s, "- Parameters:
sb- theStringBuilderto append to
-
wrapRunnable
-
unwrap
-