Class BLCHeader.DrainStatusRef<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- com.github.benmanes.caffeine.cache.BLCHeader.PadDrainStatus<K,V>
-
- com.github.benmanes.caffeine.cache.BLCHeader.DrainStatusRef<K,V>
-
- All Implemented Interfaces:
java.util.Map<K,V>
- Direct Known Subclasses:
BoundedLocalCache
- Enclosing class:
- BLCHeader
abstract static class BLCHeader.DrainStatusRef<K,V> extends BLCHeader.PadDrainStatus<K,V>
Enforces a memory layout to avoid false sharing by padding the drain status.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static longDRAIN_STATUS_OFFSET(package private) intdrainStatusThe draining status of the buffers.(package private) static intIDLEA drain is not taking place.(package private) static intPROCESSING_TO_IDLEA drain is in progress and will transition to idle.(package private) static intPROCESSING_TO_REQUIREDA drain is in progress and will transition to required.(package private) static intREQUIREDA drain is required due to a pending write modification.-
Fields inherited from class com.github.benmanes.caffeine.cache.BLCHeader.PadDrainStatus
p000, p001, p002, p003, p004, p005, p006, p007, p008, p009, p010, p011, p012, p013, p014, p015, p016, p017, p018, p019, p020, p021, p022, p023, p024, p025, p026, p027, p028, p029, p030, p031, p032, p033, p034, p035, p036, p037, p038, p039, p040, p041, p042, p043, p044, p045, p046, p047, p048, p049, p050, p051, p052, p053, p054, p055, p056, p057, p058, p059, p060, p061, p062, p063, p064, p065, p066, p067, p068, p069, p070, p071, p072, p073, p074, p075, p076, p077, p078, p079, p080, p081, p082, p083, p084, p085, p086, p087, p088, p089, p090, p091, p092, p093, p094, p095, p096, p097, p098, p099, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112, p113, p114, p115, p116, p117, p118, p119
-
-
Constructor Summary
Constructors Constructor Description DrainStatusRef()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) booleancasDrainStatus(int expect, int update)(package private) intdrainStatus()(package private) voidlazySetDrainStatus(int drainStatus)(package private) booleanshouldDrainBuffers(boolean delayable)Returns whether maintenance work is needed.-
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values
-
-
-
-
Field Detail
-
DRAIN_STATUS_OFFSET
static final long DRAIN_STATUS_OFFSET
-
IDLE
static final int IDLE
A drain is not taking place.- See Also:
- Constant Field Values
-
REQUIRED
static final int REQUIRED
A drain is required due to a pending write modification.- See Also:
- Constant Field Values
-
PROCESSING_TO_IDLE
static final int PROCESSING_TO_IDLE
A drain is in progress and will transition to idle.- See Also:
- Constant Field Values
-
PROCESSING_TO_REQUIRED
static final int PROCESSING_TO_REQUIRED
A drain is in progress and will transition to required.- See Also:
- Constant Field Values
-
drainStatus
volatile int drainStatus
The draining status of the buffers.
-
-
Method Detail
-
shouldDrainBuffers
boolean shouldDrainBuffers(boolean delayable)
Returns whether maintenance work is needed.- Parameters:
delayable- if draining the read buffer can be delayed
-
drainStatus
int drainStatus()
-
lazySetDrainStatus
void lazySetDrainStatus(int drainStatus)
-
casDrainStatus
boolean casDrainStatus(int expect, int update)
-
-