E - type of elements in this queue, extending CDPQEntrypublic class CoDelPriorityBlockingQueue<E extends CDPQEntry> extends PriBlockingQueue<E>
Extends CoDelBlockingQueue to add priority-based dropping functionality. Implements enhanced CoDel algorithm with configurable priority thresholds and per-priority statistics.
Provides priority-aware packet dropping where higher priority packets are protected from dropping during congestion events. Includes comprehensive statistics tracking and performance monitoring for different priority levels.
Input methods are overridden to add timestamps for delay calculation. Output methods implement AQM behavior with enhanced statistics tracking for priority-based operations.
| Modifier and Type | Field and Description |
|---|---|
(package private) static AtomicLong | __iddebugging |
static int | DONT_DROP_PRIORITYif priority is >= this, never drop |
static int | MIN_PRIORITYmin priority |
static String | PROP_CODEL_INTERVALProperty key for CoDel interval |
static String | PROP_CODEL_TARGETProperty key for CoDel target delay |
_context, _log, _name, DEFAULT_BACKLOG_SIZE, DEFAULT_MAX_SIZE, PROP_BACKLOG_SIZE, PROP_MAX_SIZE| Constructor and Description |
|---|
CoDelPriorityBlockingQueue(I2PAppContext ctx,
String name,
int initialCapacity)Constructs a new CoDel priority blocking queue with default target and interval. |
CoDelPriorityBlockingQueue(I2PAppContext ctx,
String name,
int initialCapacity,
int target,
int interval)Constructs a new CoDel priority blocking queue with explicit target and interval. |
| Modifier and Type | Method and Description |
|---|---|
void | clear()clear. |
void | dispose()Remove this instance from the tuning list. |
int | drainAllTo(Collection<? super E> c)Drains all, without updating stats or dropping. |
int | drainTo(Collection<? super E> c)Updates stats and possibly drops while draining. |
int | drainTo(Collection<? super E> c,
int maxElements)Updates stats and possibly drops while draining. |
static void | expungeStaleInstances()Remove cleared (GC'd) weak references from the list. |
long | getInterval()Returns the current CoDel interval in ms. |
long | getTarget()Returns the current CoDel target delay in ms. |
boolean | isBacklogged()Has the head of the queue been waiting too long,
or is the queue too big? |
E | poll()poll. |
void | setInterval(long interval)Sets the current CoDel interval in ms. |
void | setTarget(long target)Sets the current CoDel target delay in ms. |
E | take()take. |
protected void | timestamp(E o)timestamp. |
static void | updateAllIntervals(long interval)Update the interval for all active instances. |
static void | updateAllTargets(long target)Update the target delay for all active instances. |
offeradd, comparator, contains, iterator, offer, peek, poll, put, remainingCapacity, remove, size, spliterator, toArray, toArray, toStringaddAll, element, removecontainsAll, isEmpty, removeAll, retainAllclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddAll, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, streamstatic final AtomicLong __id
public static final int DONT_DROP_PRIORITY
public static final int MIN_PRIORITY
public static final String PROP_CODEL_INTERVAL
public static final String PROP_CODEL_TARGET
public CoDelPriorityBlockingQueue(I2PAppContext ctx, String name, int initialCapacity)
ctx - the I2P application contextname - a name for this queue instanceinitialCapacity - the initial capacity for the priority queuepublic CoDelPriorityBlockingQueue(I2PAppContext ctx, String name, int initialCapacity, int target, int interval)
ctx - the I2P application contextname - for statsinitialCapacity - the initial capacity for the priority queuetarget - the CoDel target delay in msinterval - the CoDel interval in mspublic void clear()
clear in interface Collection<E extends CDPQEntry>clear in class PriorityBlockingQueue<E extends CDPQEntry>public void dispose()
public int drainAllTo(Collection<? super E> c)
c - the collection to drain intopublic int drainTo(Collection<? super E> c)
drainTo in interface BlockingQueue<E extends CDPQEntry>drainTo in class PriorityBlockingQueue<E extends CDPQEntry>public int drainTo(Collection<? super E> c, int maxElements)
drainTo in interface BlockingQueue<E extends CDPQEntry>drainTo in class PriorityBlockingQueue<E extends CDPQEntry>public static void expungeStaleInstances()
public long getInterval()
public long getTarget()
public boolean isBacklogged()
isBacklogged in class PriBlockingQueue<E extends CDPQEntry>public E poll()
public void setInterval(long interval)
interval - the new interval in mspublic void setTarget(long target)
target - the new target delay in mspublic E take() throws InterruptedException
take in interface BlockingQueue<E extends CDPQEntry>take in class PriorityBlockingQueue<E extends CDPQEntry>InterruptedExceptionprotected void timestamp(E o)
timestamp in class PriBlockingQueue<E extends CDPQEntry>o - the element to timestamppublic static void updateAllIntervals(long interval)
interval - the new interval in mspublic static void updateAllTargets(long target)
target - the new target delay in ms