Serializable
, Iterable<E>
, Collection<E>
, BlockingQueue<E>
, Queue<E>
public class CoDelPriorityBlockingQueue<E extends CDPQEntry> extends PriBlockingQueue<E>
Modifier and Type | Field | Description |
---|---|---|
(package private) static AtomicLong |
__id |
debugging
|
static int |
DONT_DROP_PRIORITY |
if priority is >= this, never drop
|
static int |
MIN_PRIORITY |
_context, _log, _name, BACKLOG_SIZE, MAX_SIZE, RATES
Constructor | Description |
---|---|
CoDelPriorityBlockingQueue(I2PAppContext ctx,
String name,
int initialCapacity) |
Modifier and Type | Method | Description |
---|---|---|
void |
clear() |
|
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.
|
boolean |
isBacklogged() |
Has the head of the queue been waiting too long,
or is the queue too big?
|
E |
poll() |
|
E |
take() |
|
protected void |
timestamp(E o) |
containsAll, isEmpty, removeAll, retainAll
addAll, element, remove
addAll, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, stream
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
add, offer, offer, put
comparator, contains, iterator, peek, poll, remainingCapacity, remove, size, spliterator, toArray, toArray, toString
static final AtomicLong __id
public static final int MIN_PRIORITY
public static final int DONT_DROP_PRIORITY
public CoDelPriorityBlockingQueue(I2PAppContext ctx, String name, int initialCapacity)
name
- for statspublic void clear()
clear
in interface Collection<E extends CDPQEntry>
clear
in class PriorityBlockingQueue<E extends CDPQEntry>
public E take() throws InterruptedException
take
in interface BlockingQueue<E extends CDPQEntry>
take
in class PriorityBlockingQueue<E extends CDPQEntry>
InterruptedException
public E poll()
public 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 int drainAllTo(Collection<? super E> c)
public boolean isBacklogged()
isBacklogged
in class PriBlockingQueue<E extends CDPQEntry>
protected void timestamp(E o)
timestamp
in class PriBlockingQueue<E extends CDPQEntry>