E - the type of elements held in the target queuepublic class HeapQueueingStrategy<E> extends java.lang.Object implements QueueingStrategy<E>
| Constructor and Description |
|---|
HeapQueueingStrategy(double percentOfHeapBeforeFlowControl,
long maxDelay,
long dequeueHint)
Construct a new
HeapQueueingStrategy with the given parameters. |
| Modifier and Type | Method and Description |
|---|---|
void |
onAfterAdd()
Perform this action after adding a value to the queue.
|
void |
onAfterRemove(E value)
Increment the count of removed items from the queue.
|
void |
onBeforeAdd(E value)
Block for a varying amount based on how close the system is to the max
heap space.
|
void |
onBeforeRemove()
Perform this action before removing a value from the queue.
|
public HeapQueueingStrategy(double percentOfHeapBeforeFlowControl,
long maxDelay,
long dequeueHint)
HeapQueueingStrategy with the given parameters.percentOfHeapBeforeFlowControl - the percentage of the heap that must be available before the
queue begins to start delaying addition operationsmaxDelay - the maximum amount of time to delay an addition operation in
millisecondsdequeueHint - after this many dequeue operations, signal the JVM to run a
garbage collectionpublic void onBeforeAdd(E value)
onBeforeAdd in interface QueueingStrategy<E>value - value that is to be added to the queuepublic void onAfterAdd()
QueueingStrategyonAfterAdd in interface QueueingStrategy<E>public void onBeforeRemove()
QueueingStrategyonBeforeRemove in interface QueueingStrategy<E>public void onAfterRemove(E value)
onAfterRemove in interface QueueingStrategy<E>value - value that was removed from the queue