Package net.i2p.router.util
Class PriBlockingQueue<E extends PQEntry>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractQueue<E>
java.util.concurrent.PriorityBlockingQueue<E>
net.i2p.router.util.PriBlockingQueue<E>
- All Implemented Interfaces:
Serializable,Iterable<E>,Collection<E>,BlockingQueue<E>,Queue<E>
- Direct Known Subclasses:
CoDelPriorityBlockingQueue
Priority Blocking Queue using methods in the entries,
as defined in PQEntry, to store priority and sequence number,
ensuring FIFO order within a priority.
Input: add(), offer(), and put() are overridden to add a sequence number.
- Since:
- 0.9.3
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final I2PAppContextprotected final Logprotected final Stringprotected static final intprotected static final intprotected static final long[] -
Constructor Summary
ConstructorsConstructorDescriptionPriBlockingQueue(I2PAppContext ctx, String name, int initialCapacity) Bounded queue with a hardcoded failsafe max size, except when using put(), which is unbounded. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.use offer(o)booleanIs the queue too big?booleanReturns false if fullbooleanDeprecated.use offer(o)voidDeprecated.use offer(o)protected voidMethods inherited from class java.util.concurrent.PriorityBlockingQueue
clear, comparator, contains, drainTo, drainTo, forEach, iterator, peek, poll, poll, remainingCapacity, remove, removeAll, removeIf, retainAll, size, spliterator, take, toArray, toArray, toStringMethods inherited from class java.util.AbstractQueue
addAll, element, removeMethods inherited from class java.util.AbstractCollection
containsAll, isEmptyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
addAll, containsAll, equals, hashCode, isEmpty, parallelStream, stream, toArray
-
Field Details
-
_context
-
_log
-
_name
-
RATES
protected static final long[] RATES -
BACKLOG_SIZE
protected static final int BACKLOG_SIZE- See Also:
-
MAX_SIZE
protected static final int MAX_SIZE- See Also:
-
-
Constructor Details
-
PriBlockingQueue
Bounded queue with a hardcoded failsafe max size, except when using put(), which is unbounded.
-
-
Method Details
-
add
Deprecated.use offer(o)OpenJDK add(o) calls offer(o), so use offer(o) to avoid dup stamping. Returns false if full -
offer
Returns false if full -
offer
Deprecated.use offer(o)OpenJDK offer(o, timeout, unit) calls offer(o), so use offer(o) to avoid dup stamping. Non blocking. Returns false if full.- Specified by:
offerin interfaceBlockingQueue<E extends PQEntry>- Overrides:
offerin classPriorityBlockingQueue<E extends PQEntry>- Parameters:
timeout- ignoredunit- ignored
-
put
Deprecated.use offer(o)OpenJDK put(o) calls offer(o), so use offer(o) to avoid dup stamping. Non blocking. Does not add if full.- Specified by:
putin interfaceBlockingQueue<E extends PQEntry>- Overrides:
putin classPriorityBlockingQueue<E extends PQEntry>
-
isBacklogged
public boolean isBacklogged()Is the queue too big? -
timestamp
-