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 long
private final JCToolsBlockingQueueFactory.WaitStrategy
Fields 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, relaxedPoll
Methods inherited from class java.util.AbstractQueue
add, addAll, element, remove
Methods inherited from class java.util.AbstractCollection
contains, containsAll, remove, removeAll, retainAll, toArray, toArray
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.concurrent.BlockingQueue
add, contains, remove
Methods 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:
drainTo
in interfaceBlockingQueue<E>
-
drainTo
- Specified by:
drainTo
in interfaceBlockingQueue<E>
-
offer
- Specified by:
offer
in interfaceBlockingQueue<E>
- Throws:
InterruptedException
-
poll
- Specified by:
poll
in interfaceBlockingQueue<E>
- Throws:
InterruptedException
-
put
- Specified by:
put
in interfaceBlockingQueue<E>
- Throws:
InterruptedException
-
offer
-
remainingCapacity
public int remainingCapacity()- Specified by:
remainingCapacity
in interfaceBlockingQueue<E>
-
take
- Specified by:
take
in interfaceBlockingQueue<E>
- Throws:
InterruptedException
-
lvConsumerIndex
public final long lvConsumerIndex() -
lvProducerIndex
public final long lvProducerIndex() -
size
public int size()- Specified by:
size
in interfaceCollection<E extends Object>
- Specified by:
size
in interfaceorg.jctools.queues.MessagePassingQueue<E extends Object>
- Specified by:
size
in classAbstractCollection<E extends Object>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<E extends Object>
- Specified by:
isEmpty
in interfaceorg.jctools.queues.MessagePassingQueue<E extends Object>
- Overrides:
isEmpty
in classAbstractCollection<E extends Object>
-
toString
- Overrides:
toString
in classAbstractCollection<E extends Object>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<E extends Object>
- Specified by:
clear
in interfaceorg.jctools.queues.MessagePassingQueue<E extends Object>
- Overrides:
clear
in classAbstractQueue<E extends Object>
-
capacity
public int capacity()- Specified by:
capacity
in interfaceorg.jctools.queues.IndexedQueueSizeUtil.IndexedQueue
- Specified by:
capacity
in interfaceorg.jctools.queues.MessagePassingQueue<E extends Object>
-
currentProducerIndex
public long currentProducerIndex()- Specified by:
currentProducerIndex
in interfaceorg.jctools.queues.QueueProgressIndicators
-
currentConsumerIndex
public long currentConsumerIndex()- Specified by:
currentConsumerIndex
in interfaceorg.jctools.queues.QueueProgressIndicators
-
iterator
- Specified by:
iterator
in interfaceCollection<E extends Object>
- Specified by:
iterator
in interfaceIterable<E extends Object>
- Specified by:
iterator
in classAbstractCollection<E extends Object>
-