Class GrowableMpScArrayConsumerBlockingQueue<T>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractQueue<T>
org.apache.bookkeeper.common.collections.GrowableMpScArrayConsumerBlockingQueue<T>
- All Implemented Interfaces:
Iterable<T>,Collection<T>,BlockingQueue<T>,Queue<T>
public class GrowableMpScArrayConsumerBlockingQueue<T>
extends AbstractQueue<T>
implements BlockingQueue<T>
This implements a
BlockingQueue backed by an array with no fixed capacity.
When the capacity is reached, data will be moved to a bigger array.
This queue only allows 1 consumer thread to dequeue items and multiple producer threads.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.AbstractQueue
addAllMethods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArrayMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.concurrent.BlockingQueue
contains, removeMethods inherited from interface java.util.Collection
addAll, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
-
Constructor Details
-
GrowableMpScArrayConsumerBlockingQueue
public GrowableMpScArrayConsumerBlockingQueue() -
GrowableMpScArrayConsumerBlockingQueue
public GrowableMpScArrayConsumerBlockingQueue(int initialCapacity)
-
-
Method Details
-
remove
-
poll
-
element
-
peek
-
offer
-
put
- Specified by:
putin interfaceBlockingQueue<T>
-
add
- Specified by:
addin interfaceBlockingQueue<T>- Specified by:
addin interfaceCollection<T>- Specified by:
addin interfaceQueue<T>- Overrides:
addin classAbstractQueue<T>
-
offer
- Specified by:
offerin interfaceBlockingQueue<T>
-
take
- Specified by:
takein interfaceBlockingQueue<T>- Throws:
InterruptedException
-
poll
- Specified by:
pollin interfaceBlockingQueue<T>- Throws:
InterruptedException
-
remainingCapacity
public int remainingCapacity()- Specified by:
remainingCapacityin interfaceBlockingQueue<T>
-
drainTo
- Specified by:
drainToin interfaceBlockingQueue<T>
-
drainTo
- Specified by:
drainToin interfaceBlockingQueue<T>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<T>- Overrides:
clearin classAbstractQueue<T>
-
size
public int size()- Specified by:
sizein interfaceCollection<T>- Specified by:
sizein classAbstractCollection<T>
-
iterator
- Specified by:
iteratorin interfaceCollection<T>- Specified by:
iteratorin interfaceIterable<T>- Specified by:
iteratorin classAbstractCollection<T>
-
toString
- Overrides:
toStringin classAbstractCollection<T>
-