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 interface
EsThreadPoolExecutor.ShutdownListener
Nested 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 void
afterExecute(java.lang.Runnable r, java.lang.Throwable t)
protected void
appendThreadPoolExecutorDetails(java.lang.StringBuilder sb)
Append details about this thread pool to the specifiedStringBuilder
.void
execute(java.lang.Runnable command)
java.util.stream.Stream<java.lang.Runnable>
getTasks()
Returns a stream of all pending tasks.protected void
terminated()
java.lang.String
toString()
protected java.lang.Runnable
unwrap(java.lang.Runnable runnable)
protected java.lang.Runnable
wrapRunnable(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:
terminated
in classjava.util.concurrent.ThreadPoolExecutor
-
execute
public void execute(java.lang.Runnable command)- Specified by:
execute
in interfacejava.util.concurrent.Executor
- Overrides:
execute
in classjava.util.concurrent.ThreadPoolExecutor
-
afterExecute
protected void afterExecute(java.lang.Runnable r, java.lang.Throwable t)- Overrides:
afterExecute
in 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 submittedRunnable
instances rather than potentially wrapped ones. -
toString
public final java.lang.String toString()- Overrides:
toString
in 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
- theStringBuilder
to append to
-
wrapRunnable
protected java.lang.Runnable wrapRunnable(java.lang.Runnable command) -
unwrap
protected java.lang.Runnable unwrap(java.lang.Runnable runnable)
-