Top Description Constructors Methods
io.netty5.util.internal.shaded.org.jctools.queues.unpadded

public Class MpscUnboundedUnpaddedArrayQueue<E>

extends BaseMpscLinkedUnpaddedArrayQueue<E>
Class Inheritance
Static Imports
io.netty5.util.internal.shaded.org.jctools.queues.LinkedArrayQueueUtil.length

Note

This class was automatically generated by io.netty5.util.internal.shaded.org.jctools.queues.unpadded.JavaParsingUnpaddedQueueGenerator which can found in the jctools-build module. The original source file is MpscUnboundedArrayQueue.java. An MPSC array queue which starts at initialCapacity and grows indefinitely in linked chunks of the initial size. The queue grows only when the current chunk is full and elements are not copied on resize, instead a link to the new chunk is stored in the old chunk for the consumer to follow.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected long
public int
public int
public int
protected long
protected int
Inherited from io.netty5.util.internal.shaded.org.jctools.queues.unpadded.BaseMpscLinkedUnpaddedArrayQueue:
currentConsumerIndexcurrentProducerIndexdraindrainfillfillisEmptyiteratorofferpeekpollrelaxedOfferrelaxedPeekrelaxedPollsizetoString

Constructor Detail

MpscUnboundedUnpaddedArrayQueueback to summary
public MpscUnboundedUnpaddedArrayQueue(int chunkSize)

Method Detail

availableInQueueback to summary
protected long availableInQueue(long pIndex, long cIndex)

Implements abstract io.netty5.util.internal.shaded.org.jctools.queues.unpadded.BaseMpscLinkedUnpaddedArrayQueue.availableInQueue.

Returns:long

Doc from io.netty5.util.internal.shaded.org.jctools.queues.unpadded.BaseMpscLinkedUnpaddedArrayQueue.availableInQueue.

available elements in queue * 2

Annotations
@Override
capacityback to summary
public int capacity()

Implements abstract io.netty5.util.internal.shaded.org.jctools.queues.unpadded.BaseMpscLinkedUnpaddedArrayQueue.capacity.

Implements io.netty5.util.internal.shaded.org.jctools.queues.MessagePassingQueue.capacity, io.netty5.util.internal.shaded.org.jctools.queues.IndexedQueueSizeUtil.IndexedQueue.capacity.

Returns:int

Doc from io.netty5.util.internal.shaded.org.jctools.queues.MessagePassingQueue.capacity.

the capacity of this queue or MessagePassingQueue#UNBOUNDED_CAPACITY if not bounded

Annotations
@Override
drainback to summary
public int drain(MessagePassingQueue.Consumer<E> c)

Overrides io.netty5.util.internal.shaded.org.jctools.queues.unpadded.BaseMpscLinkedUnpaddedArrayQueue.drain.

Implements io.netty5.util.internal.shaded.org.jctools.queues.MessagePassingQueue.drain.

Doc from io.netty5.util.internal.shaded.org.jctools.queues.MessagePassingQueue.drain.

Remove all available item from the queue and hand to consume. This should be semantically similar to:

M m;
while((m = relaxedPoll()) != null){
c.accept(m);
}
There's no strong commitment to the queue being empty at the end of a drain. Called from a consumer thread subject to the restrictions appropriate to the implementation.

Warning

Explicit assumptions are made with regards to Consumer#accept make sure you have read and understood these before using this method.

Returns:int

the number of polled elements

Annotations
@Override
fillback to summary
public int fill(MessagePassingQueue.Supplier<E> s)

Overrides io.netty5.util.internal.shaded.org.jctools.queues.unpadded.BaseMpscLinkedUnpaddedArrayQueue.fill.

Implements io.netty5.util.internal.shaded.org.jctools.queues.MessagePassingQueue.fill.

Doc from io.netty5.util.internal.shaded.org.jctools.queues.MessagePassingQueue.fill.

Stuff the queue with elements from the supplier. Semantically similar to:

while(relaxedOffer(s.get());
There's no strong commitment to the queue being full at the end of a fill. Called from a producer thread subject to the restrictions appropriate to the implementation.

Unbounded queues will fill up the queue with a fixed amount rather than fill up to oblivion

Warning

Explicit assumptions are made with regards to Supplier#get make sure you have read and understood these before using this method.

Returns:int

the number of offered elements

Annotations
@Override
getCurrentBufferCapacityback to summary
protected long getCurrentBufferCapacity(long mask)

Implements abstract io.netty5.util.internal.shaded.org.jctools.queues.unpadded.BaseMpscLinkedUnpaddedArrayQueue.getCurrentBufferCapacity.

Returns:long

Doc from io.netty5.util.internal.shaded.org.jctools.queues.unpadded.BaseMpscLinkedUnpaddedArrayQueue.getCurrentBufferCapacity.

current buffer capacity for elements (excluding next pointer and jump entry) * 2

Annotations
@Override
getNextBufferSizeback to summary
protected int getNextBufferSize(E[] buffer)

Implements abstract io.netty5.util.internal.shaded.org.jctools.queues.unpadded.BaseMpscLinkedUnpaddedArrayQueue.getNextBufferSize.

Returns:int

Doc from io.netty5.util.internal.shaded.org.jctools.queues.unpadded.BaseMpscLinkedUnpaddedArrayQueue.getNextBufferSize.

next buffer size(inclusive of next array pointer)

Annotations
@Override