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>
final class BoundedBuffer<E> extends StripedBuffer<E>
A striped, non-blocking, bounded buffer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
BoundedBuffer.RingBuffer<E>
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
BUFFER_SIZE
The maximum number of elements per buffer.(package private) static int
OFFSET
(package private) static int
SPACED_MASK
(package private) static int
SPACED_SIZE
-
Fields inherited from class com.github.benmanes.caffeine.cache.StripedBuffer
ATTEMPTS, MAXIMUM_TABLE_SIZE, NCPU, PROBE, table, TABLE_BUSY, tableBusy
-
-
Constructor Summary
Constructors Constructor Description BoundedBuffer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Buffer<E>
create(E e)
Creates a new buffer instance after resizing to accommodate a producer.-
Methods inherited from class com.github.benmanes.caffeine.cache.StripedBuffer
advanceProbe, casTableBusy, ceilingNextPowerOfTwo, drainTo, expandOrRetry, getProbe, offer, reads, writes
-
-
-
-
Field Detail
-
BUFFER_SIZE
static final int BUFFER_SIZE
The maximum number of elements per buffer.- See Also:
- Constant Field Values
-
SPACED_SIZE
static final int SPACED_SIZE
- See Also:
- Constant Field Values
-
SPACED_MASK
static final int SPACED_MASK
- See Also:
- Constant Field Values
-
OFFSET
static final int OFFSET
- See Also:
- Constant Field Values
-
-
Method Detail
-
create
protected Buffer<E> create(E e)
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
-
-