Class JCToolsBlockingQueueFactory.MpscBlockingQueue<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractQueue<E>
org.jctools.queues.MpscArrayQueue<E>
org.apache.logging.log4j.core.async.JCToolsBlockingQueueFactory.MpscBlockingQueue<E>
- All Implemented Interfaces:
Iterable<E>,Collection<E>,BlockingQueue<E>,Queue<E>,org.jctools.queues.IndexedQueueSizeUtil.IndexedQueue,org.jctools.queues.MessagePassingQueue<E>,org.jctools.queues.QueueProgressIndicators,org.jctools.queues.SupportsIterator
- Enclosing class:
- JCToolsBlockingQueueFactory<E>
private static final class JCToolsBlockingQueueFactory.MpscBlockingQueue<E>
extends org.jctools.queues.MpscArrayQueue<E>
implements BlockingQueue<E>
BlockingQueue wrapper for JCTools multiple producer single consumer array queue.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jctools.queues.MessagePassingQueue
org.jctools.queues.MessagePassingQueue.Consumer<T extends Object>, org.jctools.queues.MessagePassingQueue.ExitCondition, org.jctools.queues.MessagePassingQueue.Supplier<T extends Object>, org.jctools.queues.MessagePassingQueue.WaitStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final E[]protected final longprivate final JCToolsBlockingQueueFactory.WaitStrategyFields inherited from interface org.jctools.queues.MessagePassingQueue
UNBOUNDED_CAPACITY -
Constructor Summary
ConstructorsConstructorDescriptionMpscBlockingQueue(int capacity, JCToolsBlockingQueueFactory.WaitStrategy waitStrategy) -
Method Summary
Methods inherited from class org.jctools.queues.MpscArrayQueue
drain, drain, drain, failFastOffer, fill, fill, fill, offerIfBelowThreshold, peek, poll, relaxedOffer, relaxedPeek, relaxedPollMethods inherited from class java.util.AbstractQueue
add, addAll, element, removeMethods inherited from class java.util.AbstractCollection
contains, containsAll, 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
add, contains, removeMethods inherited from interface java.util.Collection
addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
-
Field Details
-
waitStrategy
-
mask
protected final long mask -
buffer
-
-
Constructor Details
-
MpscBlockingQueue
MpscBlockingQueue(int capacity, JCToolsBlockingQueueFactory.WaitStrategy waitStrategy)
-
-
Method Details
-
drainTo
- Specified by:
drainToin interfaceBlockingQueue<E>
-
drainTo
- Specified by:
drainToin interfaceBlockingQueue<E>
-
offer
- Specified by:
offerin interfaceBlockingQueue<E>- Throws:
InterruptedException
-
poll
- Specified by:
pollin interfaceBlockingQueue<E>- Throws:
InterruptedException
-
put
- Specified by:
putin interfaceBlockingQueue<E>- Throws:
InterruptedException
-
offer
-
remainingCapacity
public int remainingCapacity()- Specified by:
remainingCapacityin interfaceBlockingQueue<E>
-
take
- Specified by:
takein interfaceBlockingQueue<E>- Throws:
InterruptedException
-
lvConsumerIndex
public final long lvConsumerIndex() -
lvProducerIndex
public final long lvProducerIndex() -
size
public int size()- Specified by:
sizein interfaceCollection<E extends Object>- Specified by:
sizein interfaceorg.jctools.queues.MessagePassingQueue<E extends Object>- Specified by:
sizein classAbstractCollection<E extends Object>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<E extends Object>- Specified by:
isEmptyin interfaceorg.jctools.queues.MessagePassingQueue<E extends Object>- Overrides:
isEmptyin classAbstractCollection<E extends Object>
-
toString
- Overrides:
toStringin classAbstractCollection<E extends Object>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<E extends Object>- Specified by:
clearin interfaceorg.jctools.queues.MessagePassingQueue<E extends Object>- Overrides:
clearin classAbstractQueue<E extends Object>
-
capacity
public int capacity()- Specified by:
capacityin interfaceorg.jctools.queues.IndexedQueueSizeUtil.IndexedQueue- Specified by:
capacityin interfaceorg.jctools.queues.MessagePassingQueue<E extends Object>
-
currentProducerIndex
public long currentProducerIndex()- Specified by:
currentProducerIndexin interfaceorg.jctools.queues.QueueProgressIndicators
-
currentConsumerIndex
public long currentConsumerIndex()- Specified by:
currentConsumerIndexin interfaceorg.jctools.queues.QueueProgressIndicators
-
iterator
- Specified by:
iteratorin interfaceCollection<E extends Object>- Specified by:
iteratorin interfaceIterable<E extends Object>- Specified by:
iteratorin classAbstractCollection<E extends Object>
-