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

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 Details

    • DRAIN_STATUS_OFFSET

      static final long DRAIN_STATUS_OFFSET
    • IDLE

      static final int IDLE
      A drain is not taking place.
      See Also:
    • REQUIRED

      static final int REQUIRED
      A drain is required due to a pending write modification.
      See Also:
    • PROCESSING_TO_IDLE

      static final int PROCESSING_TO_IDLE
      A drain is in progress and will transition to idle.
      See Also:
    • PROCESSING_TO_REQUIRED

      static final int PROCESSING_TO_REQUIRED
      A drain is in progress and will transition to required.
      See Also:
    • drainStatus

      volatile int drainStatus
      The 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)