Class PSAW<K,​V>

    • Field Detail

      • WRITE_TIME_OFFSET

        protected static final long WRITE_TIME_OFFSET
      • writeTime

        volatile long writeTime
      • previousInWriteOrder

        Node<K,​V> previousInWriteOrder
      • nextInWriteOrder

        Node<K,​V> nextInWriteOrder
    • Constructor Detail

      • PSAW

        PSAW()
      • PSAW

        PSAW​(K key,
             java.lang.ref.ReferenceQueue<K> keyReferenceQueue,
             V value,
             java.lang.ref.ReferenceQueue<V> valueReferenceQueue,
             int weight,
             long now)
      • PSAW

        PSAW​(java.lang.Object keyReference,
             V value,
             java.lang.ref.ReferenceQueue<V> valueReferenceQueue,
             int weight,
             long now)
    • Method Detail

      • getVariableTime

        public long getVariableTime()
        Description copied from class: Node
        Returns the variable expiration time, in nanoseconds.
        Overrides:
        getVariableTime in class PSA<K,​V>
      • setVariableTime

        public void setVariableTime​(long writeTime)
        Description copied from class: Node
        Sets the variable expiration time in nanoseconds. This update may be set lazily and rely on the memory fence when the lock is released.
        Overrides:
        setVariableTime in class PSA<K,​V>
      • casVariableTime

        public boolean casVariableTime​(long expect,
                                       long update)
        Description copied from class: Node
        Atomically sets the variable time to the given updated value if the current value equals the expected value and returns if the update was successful.
        Overrides:
        casVariableTime in class PSA<K,​V>
      • getWriteTime

        public final long getWriteTime()
        Description copied from class: Node
        Returns the time that this entry was last written, in ns.
        Overrides:
        getWriteTime in class Node<K,​V>
      • setWriteTime

        public final void setWriteTime​(long writeTime)
        Description copied from class: Node
        Sets the write time in nanoseconds. This update may be set lazily and rely on the memory fence when the lock is released.
        Overrides:
        setWriteTime in class Node<K,​V>
      • newNode

        public Node<K,​V> newNode​(K key,
                                       java.lang.ref.ReferenceQueue<K> keyReferenceQueue,
                                       V value,
                                       java.lang.ref.ReferenceQueue<V> valueReferenceQueue,
                                       int weight,
                                       long now)
        Description copied from interface: NodeFactory
        Returns a node optimized for the specified features.
        Specified by:
        newNode in interface NodeFactory<K,​V>
        Overrides:
        newNode in class PSA<K,​V>
      • newNode

        public Node<K,​V> newNode​(java.lang.Object keyReference,
                                       V value,
                                       java.lang.ref.ReferenceQueue<V> valueReferenceQueue,
                                       int weight,
                                       long now)
        Description copied from interface: NodeFactory
        Returns a node optimized for the specified features.
        Specified by:
        newNode in interface NodeFactory<K,​V>
        Overrides:
        newNode in class PSA<K,​V>