Class BoundedBuffer<E>
java.lang.Object
com.github.benmanes.caffeine.cache.StripedBuffer<E>
com.github.benmanes.caffeine.cache.BoundedBuffer<E>
- Type Parameters:
E
- the type of elements maintained by this buffer
- All Implemented Interfaces:
Buffer<E>
A striped, non-blocking, bounded buffer.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int
The maximum number of elements per buffer.(package private) static final int
(package private) static final int
(package private) static final int
Fields inherited from class com.github.benmanes.caffeine.cache.StripedBuffer
ATTEMPTS, MAXIMUM_TABLE_SIZE, NCPU, PROBE, table, TABLE_BUSY, tableBusy
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.github.benmanes.caffeine.cache.StripedBuffer
advanceProbe, casTableBusy, ceilingNextPowerOfTwo, drainTo, expandOrRetry, getProbe, offer, reads, writes
-
Field Details
-
BUFFER_SIZE
static final int BUFFER_SIZEThe maximum number of elements per buffer.- See Also:
-
SPACED_SIZE
static final int SPACED_SIZE- See Also:
-
SPACED_MASK
static final int SPACED_MASK- See Also:
-
OFFSET
static final int OFFSET- See Also:
-
-
Constructor Details
-
BoundedBuffer
BoundedBuffer()
-
-
Method Details
-
create
Description copied from class:StripedBuffer
Creates a new buffer instance after resizing to accommodate a producer.- Specified by:
create
in classStripedBuffer<E>
- Parameters:
e
- the producer's element- Returns:
- a newly created buffer populated with a single element
-