Top Description Fields Constructors Methods
com.github.benmanes.caffeine.cache

pack-priv Class MpscGrowableArrayQueue<E>

Additional top-level classes in compilation unit: MpscChunkedArrayQueue, MpscChunkedArrayQueueColdProducerFields, BaseMpscLinkedArrayQueuePad1, BaseMpscLinkedArrayQueueProducerFields, BaseMpscLinkedArrayQueuePad2, BaseMpscLinkedArrayQueueConsumerFields, BaseMpscLinkedArrayQueuePad3, BaseMpscLinkedArrayQueueColdProducerFields, BaseMpscLinkedArrayQueue.

extends MpscChunkedArrayQueue<E>
Class Inheritance
Static Imports
com.github.benmanes.caffeine.cache.Caffeine.ceilingPowerOfTwo

An MPSC array queue which starts at initialCapacity and grows to maxCapacity in linked chunks of the initial size. The queue grows only when the current buffer is full and elements are not copied on resize, instead a link to the new buffer is stored in the old buffer for the consumer to follow.

This is a shaded copy of MpscGrowableArrayQueue provided by JCTools from version 2.0.

Author
[email protected] (Nitsan Wakart)

Field Summary

Inherited from com.github.benmanes.caffeine.cache.MpscChunkedArrayQueue:
p000p001p002p003p004p005p006p007p008p009p010p011p012p013p014p015p016p017p018p019p020p021p022p023p024p025p026p027p028p029p030p031p032p033p034p035p036p037p038p039p040p041p042p043p044p045p046p047p048p049p050p051p052p053p054p055p056p057p058p059p060p061p062p063p064p065p066p067p068p069p070p071p072p073p074p075p076p077p078p079p080p081p082p083p084p085p086p087p088p089p090p091p092p093p094p095p096p097p098p099p100p101p102p103p104p105p106p107p108p109p110p111p112p113p114p115p116p117p118p119

Constructor Summary

AccessConstructor and Description
pack-priv
MpscGrowableArrayQueue(int
the queue initial capacity. If chunk size is fixed this will be the chunk size. Must be 2 or more.
initialCapacity
,
int
the maximum capacity will be rounded up to the closest power of 2 and will be the upper limit of number of elements in this queue. Must be 4 or more and round up to a larger power of 2 than initialCapacity.
maxCapacity
)

Method Summary

Modifier and TypeMethod and Description
protected long
protected int
Inherited from com.github.benmanes.caffeine.cache.MpscChunkedArrayQueue:
availableInQueuecapacity

Constructor Detail

MpscGrowableArrayQueueback to summary
pack-priv MpscGrowableArrayQueue(int initialCapacity, int maxCapacity)
Parameters
initialCapacity:int

the queue initial capacity. If chunk size is fixed this will be the chunk size. Must be 2 or more.

maxCapacity:int

the maximum capacity will be rounded up to the closest power of 2 and will be the upper limit of number of elements in this queue. Must be 4 or more and round up to a larger power of 2 than initialCapacity.

Method Detail

getCurrentBufferCapacityback to summary
protected long getCurrentBufferCapacity(long mask)

Implements abstract com.github.benmanes.caffeine.cache.BaseMpscLinkedArrayQueue.getCurrentBufferCapacity.

Returns:long

Doc from com.github.benmanes.caffeine.cache.BaseMpscLinkedArrayQueue.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 com.github.benmanes.caffeine.cache.BaseMpscLinkedArrayQueue.getNextBufferSize.

Returns:int

Doc from com.github.benmanes.caffeine.cache.BaseMpscLinkedArrayQueue.getNextBufferSize.

next buffer size(inclusive of next array pointer)

Annotations
@Override