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.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      DrainStatusRef()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) boolean casDrainStatus​(int expect, int update)  
      (package private) int drainStatus()  
      (package private) void lazySetDrainStatus​(int drainStatus)  
      (package private) boolean shouldDrainBuffers​(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
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
    • 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)