Class EsThreadPoolExecutor
- java.lang.Object
-
- java.util.concurrent.AbstractExecutorService
-
- java.util.concurrent.ThreadPoolExecutor
-
- org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor
-
- All Implemented Interfaces:
Executor,ExecutorService
- Direct Known Subclasses:
PrioritizedEsThreadPoolExecutor,QueueResizingEsThreadPoolExecutor
public class EsThreadPoolExecutor extends 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.ShutdownListener-
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafterExecute(Runnable r, Throwable t)protected voidappendThreadPoolExecutorDetails(StringBuilder sb)Append details about this thread pool to the specifiedStringBuilder.voidexecute(Runnable command)Stream<Runnable>getTasks()Returns a stream of all pending tasks.protected voidterminated()StringtoString()protected Runnableunwrap(Runnable runnable)protected 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, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow
-
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
-
-
-
-
Method Detail
-
terminated
protected void terminated()
- Overrides:
terminatedin classThreadPoolExecutor
-
execute
public void execute(Runnable command)
- Specified by:
executein interfaceExecutor- Overrides:
executein classThreadPoolExecutor
-
afterExecute
protected void afterExecute(Runnable r, Throwable t)
- Overrides:
afterExecutein classThreadPoolExecutor
-
getTasks
public Stream<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 String toString()
- Overrides:
toStringin classThreadPoolExecutor
-
appendThreadPoolExecutorDetails
protected void appendThreadPoolExecutorDetails(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
-
-