Class EsThreadPoolExecutor
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor
- All Implemented Interfaces:
java.util.concurrent.Executor,java.util.concurrent.ExecutorService
- Direct Known Subclasses:
PrioritizedEsThreadPoolExecutor,QueueResizingEsThreadPoolExecutor
public class EsThreadPoolExecutor
extends java.util.concurrent.ThreadPoolExecutor
An extension to thread pool executor, allowing (in the future) to add specific additional stats to it.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceEsThreadPoolExecutor.ShutdownListenerNested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy -
Method Summary
Modifier and Type Method Description protected voidafterExecute(java.lang.Runnable r, java.lang.Throwable t)protected voidappendThreadPoolExecutorDetails(java.lang.StringBuilder sb)Append details about this thread pool to the specifiedStringBuilder.voidexecute(java.lang.Runnable command)java.util.stream.Stream<java.lang.Runnable>getTasks()Returns a stream of all pending tasks.protected voidterminated()java.lang.StringtoString()protected java.lang.Runnableunwrap(java.lang.Runnable runnable)protected java.lang.RunnablewrapRunnable(java.lang.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, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow
-
Method Details
-
terminated
protected void terminated()- Overrides:
terminatedin classjava.util.concurrent.ThreadPoolExecutor
-
execute
public void execute(java.lang.Runnable command)- Specified by:
executein interfacejava.util.concurrent.Executor- Overrides:
executein classjava.util.concurrent.ThreadPoolExecutor
-
afterExecute
protected void afterExecute(java.lang.Runnable r, java.lang.Throwable t)- Overrides:
afterExecutein classjava.util.concurrent.ThreadPoolExecutor
-
getTasks
public java.util.stream.Stream<java.lang.Runnable> 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
public final java.lang.String toString()- Overrides:
toStringin classjava.util.concurrent.ThreadPoolExecutor
-
appendThreadPoolExecutorDetails
protected void appendThreadPoolExecutorDetails(java.lang.StringBuilder sb)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
protected java.lang.Runnable wrapRunnable(java.lang.Runnable command) -
unwrap
protected java.lang.Runnable unwrap(java.lang.Runnable runnable)
-