Module org.elasticsearch.server
Class PrioritizedThrottledTaskRunner<T extends AbstractRunnable & Comparable<T>>
java.lang.Object
org.elasticsearch.common.util.concurrent.PrioritizedThrottledTaskRunner<T>
public class PrioritizedThrottledTaskRunner<T extends AbstractRunnable & Comparable<T>>
extends Object
PrioritizedThrottledTaskRunner
performs the enqueued tasks in the order dictated by the
natural ordering of the tasks, limiting the max number of concurrently running tasks. Each new task
that is dequeued to be run, is forked off to the given executor.-
Constructor Summary
ConstructorsConstructorDescriptionPrioritizedThrottledTaskRunner
(String name, int maxRunningTasks, Executor executor) -
Method Summary
-
Constructor Details
-
PrioritizedThrottledTaskRunner
-
-
Method Details
-
enqueueTask
Submits a task for execution. If there are fewer thanmaxRunningTasks
tasks currently running then this task is immediately submitted to the executor. Otherwise this task is enqueued and will be submitted to the executor in turn on completion of some other task. -
runningTasks
public int runningTasks() -
queueSize
public int queueSize()
-