Class TrackingLinkedBlockingQueue<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractQueue<E>
-
- java.util.concurrent.LinkedBlockingQueue<E>
-
- org.opendaylight.yangtools.util.concurrent.TrackingLinkedBlockingQueue<E>
-
- Type Parameters:
E
- the element t.ype
- All Implemented Interfaces:
Serializable
,Iterable<E>
,Collection<E>
,BlockingQueue<E>
,Queue<E>
public class TrackingLinkedBlockingQueue<E> extends LinkedBlockingQueue<E>
ALinkedBlockingQueue
that tracks the largest queue size for debugging.- Author:
- Thomas Pantelis
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TrackingLinkedBlockingQueue()
TrackingLinkedBlockingQueue(int capacity)
TrackingLinkedBlockingQueue(@NonNull Collection<? extends E> c)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(E e)
boolean
addAll(Collection<? extends E> c)
long
getLargestQueueSize()
Returns the largest queue size.boolean
offer(E e)
boolean
offer(E e, long timeout, TimeUnit unit)
void
put(E e)
-
Methods inherited from class java.util.concurrent.LinkedBlockingQueue
clear, contains, drainTo, drainTo, forEach, iterator, peek, poll, poll, remainingCapacity, remove, removeAll, removeIf, retainAll, size, spliterator, take, toArray, toArray, toString
-
Methods inherited from class java.util.AbstractQueue
element, remove
-
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
containsAll, equals, hashCode, isEmpty, parallelStream, stream, toArray
-
-
-
-
Constructor Detail
-
TrackingLinkedBlockingQueue
public TrackingLinkedBlockingQueue()
-
TrackingLinkedBlockingQueue
public TrackingLinkedBlockingQueue(@NonNull Collection<? extends E> c)
-
TrackingLinkedBlockingQueue
public TrackingLinkedBlockingQueue(int capacity)
-
-
Method Detail
-
getLargestQueueSize
@Beta public long getLargestQueueSize()
Returns the largest queue size.FIXME: the this return will be changed to int in a future release.
-
offer
public boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException
- Specified by:
offer
in interfaceBlockingQueue<E>
- Overrides:
offer
in classLinkedBlockingQueue<E>
- Throws:
InterruptedException
-
offer
public boolean offer(E e)
- Specified by:
offer
in interfaceBlockingQueue<E>
- Specified by:
offer
in interfaceQueue<E>
- Overrides:
offer
in classLinkedBlockingQueue<E>
-
put
public void put(E e) throws InterruptedException
- Specified by:
put
in interfaceBlockingQueue<E>
- Overrides:
put
in classLinkedBlockingQueue<E>
- Throws:
InterruptedException
-
add
public boolean add(E e)
- Specified by:
add
in interfaceBlockingQueue<E>
- Specified by:
add
in interfaceCollection<E>
- Specified by:
add
in interfaceQueue<E>
- Overrides:
add
in classAbstractQueue<E>
-
addAll
public boolean addAll(Collection<? extends E> c)
- Specified by:
addAll
in interfaceCollection<E>
- Overrides:
addAll
in classAbstractQueue<E>
-
-