Class 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 Detail

      • DRAIN_STATUS_OFFSET

        static final long DRAIN_STATUS_OFFSET
      • 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.
    • Constructor Detail

      • DrainStatusRef

        DrainStatusRef()
    • 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)