|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractQueue<E>
java.util.concurrent.LinkedBlockingQueue<E>
org.elasticsearch.common.util.concurrent.DynamicThreadPoolExecutor.DynamicQueue<E>
public static class DynamicThreadPoolExecutor.DynamicQueue<E>
Much like a SynchronousQueue which acts as a rendezvous channel. It
is well suited for handoff designs, in which a tasks is only queued if there
is an available thread to pick it up.
RejectedExecutionHandler policies:
DynamicThreadPoolExecutor.ForceQueuePolicy - forces the queue to accept the rejected task. DynamicThreadPoolExecutor.TimedBlockingPolicy - waits for a given time for the task to be
executed.
| Constructor Summary | |
|---|---|
DynamicThreadPoolExecutor.DynamicQueue()
Creates a DynamicQueue with a capacity of Integer.MAX_VALUE. |
|
DynamicThreadPoolExecutor.DynamicQueue(int capacity)
Creates a DynamicQueue with the given (fixed) capacity. |
|
| Method Summary | |
|---|---|
boolean |
offer(E o)
Inserts the specified element at the tail of this queue if there is at least one available thread to run the current task. |
void |
setThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor executor)
Sets the executor this queue belongs to. |
| Methods inherited from class java.util.concurrent.LinkedBlockingQueue |
|---|
clear, drainTo, drainTo, iterator, offer, peek, poll, poll, put, remainingCapacity, remove, size, take, toArray, toArray, toString |
| Methods inherited from class java.util.AbstractQueue |
|---|
add, addAll, element, remove |
| Methods inherited from class java.util.AbstractCollection |
|---|
contains, containsAll, isEmpty, removeAll, retainAll |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.concurrent.BlockingQueue |
|---|
add, contains |
| Methods inherited from interface java.util.Queue |
|---|
element, remove |
| Methods inherited from interface java.util.Collection |
|---|
addAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAll |
| Constructor Detail |
|---|
public DynamicThreadPoolExecutor.DynamicQueue()
Integer.MAX_VALUE.
public DynamicThreadPoolExecutor.DynamicQueue(int capacity)
capacity - the capacity of this queue.| Method Detail |
|---|
public void setThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor executor)
public boolean offer(E o)
offer in interface java.util.concurrent.BlockingQueue<E>offer in interface java.util.Queue<E>offer in class java.util.concurrent.LinkedBlockingQueue<E>o - the element to add.
ThreadPoolExecutor.execute(Runnable)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||