Class JCToolsBlockingQueueFactory.MpscBlockingQueue<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractQueue<E>
-
- org.jctools.queues.ConcurrentCircularArrayQueue<E>
-
- org.jctools.queues.MpscArrayQueue<E>
-
- org.apache.logging.log4j.core.async.JCToolsBlockingQueueFactory.MpscBlockingQueue<E>
-
- All Implemented Interfaces:
java.lang.Iterable<E>,java.util.Collection<E>,java.util.concurrent.BlockingQueue<E>,java.util.Queue<E>,org.jctools.queues.IndexedQueueSizeUtil.IndexedQueue,org.jctools.queues.MessagePassingQueue<E>,org.jctools.queues.QueueProgressIndicators
- Enclosing class:
- JCToolsBlockingQueueFactory<E>
private static final class JCToolsBlockingQueueFactory.MpscBlockingQueue<E> extends org.jctools.queues.MpscArrayQueue<E> implements java.util.concurrent.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 java.lang.Object>, org.jctools.queues.MessagePassingQueue.ExitCondition, org.jctools.queues.MessagePassingQueue.Supplier<T extends java.lang.Object>, org.jctools.queues.MessagePassingQueue.WaitStrategy
-
-
Field Summary
Fields Modifier and Type Field Description protected longconsumerIndexprivate JCToolsBlockingQueueFactory.WaitStrategywaitStrategy
-
Constructor Summary
Constructors Constructor Description MpscBlockingQueue(int capacity, JCToolsBlockingQueueFactory.WaitStrategy waitStrategy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancasProducerIndex(long arg0, long arg1)intdrainTo(java.util.Collection<? super E> c)intdrainTo(java.util.Collection<? super E> c, int maxElements)protected longlpConsumerIndex()longlvConsumerIndex()longlvProducerIndex()protected longlvProducerLimit()booleanoffer(E e)booleanoffer(E e, long timeout, java.util.concurrent.TimeUnit unit)Epoll(long timeout, java.util.concurrent.TimeUnit unit)voidput(E e)intremainingCapacity()protected voidsoConsumerIndex(long arg0)protected voidsoProducerLimit(long arg0)Etake()-
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 org.jctools.queues.ConcurrentCircularArrayQueue
calcElementOffset, calcElementOffset, capacity, clear, currentConsumerIndex, currentProducerIndex, isEmpty, iterator, size, toString
-
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
-
-
-
-
Field Detail
-
waitStrategy
private final JCToolsBlockingQueueFactory.WaitStrategy waitStrategy
-
consumerIndex
protected long consumerIndex
-
-
Constructor Detail
-
MpscBlockingQueue
MpscBlockingQueue(int capacity, JCToolsBlockingQueueFactory.WaitStrategy waitStrategy)
-
-
Method Detail
-
drainTo
public int drainTo(java.util.Collection<? super E> c)
- Specified by:
drainToin interfacejava.util.concurrent.BlockingQueue<E>
-
drainTo
public int drainTo(java.util.Collection<? super E> c, int maxElements)
- Specified by:
drainToin interfacejava.util.concurrent.BlockingQueue<E>
-
offer
public boolean offer(E e, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
- Specified by:
offerin interfacejava.util.concurrent.BlockingQueue<E>- Throws:
java.lang.InterruptedException
-
poll
public E poll(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
- Specified by:
pollin interfacejava.util.concurrent.BlockingQueue<E>- Throws:
java.lang.InterruptedException
-
put
public void put(E e) throws java.lang.InterruptedException
- Specified by:
putin interfacejava.util.concurrent.BlockingQueue<E>- Throws:
java.lang.InterruptedException
-
offer
public boolean offer(E e)
-
remainingCapacity
public int remainingCapacity()
- Specified by:
remainingCapacityin interfacejava.util.concurrent.BlockingQueue<E>
-
take
public E take() throws java.lang.InterruptedException
- Specified by:
takein interfacejava.util.concurrent.BlockingQueue<E>- Throws:
java.lang.InterruptedException
-
lpConsumerIndex
protected final long lpConsumerIndex()
-
lvConsumerIndex
public final long lvConsumerIndex()
-
soConsumerIndex
protected void soConsumerIndex(long arg0)
-
lvProducerLimit
protected final long lvProducerLimit()
-
soProducerLimit
protected final void soProducerLimit(long arg0)
-
lvProducerIndex
public final long lvProducerIndex()
-
casProducerIndex
protected final boolean casProducerIndex(long arg0, long arg1)
-
-