public class PrioritizedEsThreadPoolExecutor extends EsThreadPoolExecutor
PrioritizedRunnable
and/or PrioritizedCallable
, those tasks that are not instances of these two will
be wrapped and assign a default Priority.NORMAL
priority.
Note, if two tasks have the same priority, the first to arrive will be executed first (FIFO style).
Modifier and Type | Class and Description |
---|---|
static class |
PrioritizedEsThreadPoolExecutor.Pending |
EsThreadPoolExecutor.ShutdownListener
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
Modifier and Type | Method and Description |
---|---|
protected void |
afterExecute(Runnable r,
Throwable t) |
protected void |
beforeExecute(Thread t,
Runnable r) |
void |
execute(Runnable command) |
void |
execute(Runnable command,
ScheduledExecutorService timer,
TimeValue timeout,
Runnable timeoutCallback) |
TimeValue |
getMaxTaskWaitTime()
Returns the waiting time of the first task in the queue
|
int |
getNumberOfPendingTasks() |
PrioritizedEsThreadPoolExecutor.Pending[] |
getPending() |
protected <T> RunnableFuture<T> |
newTaskFor(Callable<T> callable) |
protected <T> RunnableFuture<T> |
newTaskFor(Runnable runnable,
T value) |
shutdown, terminated, toString
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, 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
public PrioritizedEsThreadPoolExecutor.Pending[] getPending()
public int getNumberOfPendingTasks()
public TimeValue getMaxTaskWaitTime()
protected void beforeExecute(Thread t, Runnable r)
beforeExecute
in class ThreadPoolExecutor
protected void afterExecute(Runnable r, Throwable t)
afterExecute
in class ThreadPoolExecutor
public void execute(Runnable command, ScheduledExecutorService timer, TimeValue timeout, Runnable timeoutCallback)
public void execute(Runnable command)
execute
in interface Executor
execute
in class EsThreadPoolExecutor
protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T value)
newTaskFor
in class AbstractExecutorService
protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable)
newTaskFor
in class AbstractExecutorService
Copyright © 2009–2016. All rights reserved.