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:
Map<K,V>
- Direct Known Subclasses:
BoundedLocalCache
- Enclosing class:
BLCHeader
Enforces a memory layout to avoid false sharing by padding the drain status.
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final long(package private) intThe draining status of the buffers.(package private) static final intA drain is not taking place.(package private) static final intA drain is in progress and will transition to idle.(package private) static final intA drain is in progress and will transition to required.(package private) static final intA drain is required due to a pending write modification.Fields inherited from class 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 -
Method Summary
Modifier and TypeMethodDescription(package private) booleancasDrainStatus(int expect, int update) (package private) int(package private) voidlazySetDrainStatus(int drainStatus) (package private) booleanshouldDrainBuffers(boolean delayable) Returns whether maintenance work is needed.Methods inherited from class AbstractMap
clear, clone, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, valuesMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
DRAIN_STATUS_OFFSET
static final long DRAIN_STATUS_OFFSET -
IDLE
static final int IDLEA drain is not taking place.- See Also:
-
REQUIRED
static final int REQUIREDA drain is required due to a pending write modification.- See Also:
-
PROCESSING_TO_IDLE
static final int PROCESSING_TO_IDLEA drain is in progress and will transition to idle.- See Also:
-
PROCESSING_TO_REQUIRED
static final int PROCESSING_TO_REQUIREDA drain is in progress and will transition to required.- See Also:
-
drainStatus
volatile int drainStatusThe draining status of the buffers.
-
-
Constructor Details
-
DrainStatusRef
DrainStatusRef()
-
-
Method Details
-
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)
-