Class PDR<K,V>
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.Node<K,V>
-
- com.github.benmanes.caffeine.cache.PD<K,V>
-
- com.github.benmanes.caffeine.cache.PDR<K,V>
-
- All Implemented Interfaces:
AccessOrderDeque.AccessOrder<Node<K,V>>,NodeFactory<K,V>,WriteOrderDeque.WriteOrder<Node<K,V>>
class PDR<K,V> extends PD<K,V>
WARNING: GENERATED CODE A cache entry that provides the following features:- RefreshWrite
- StrongKeys (inherited)
- SoftValues (inherited)
-
-
Field Summary
Fields Modifier and Type Field Description protected static longWRITE_TIME_OFFSET(package private) longwriteTime-
Fields inherited from class com.github.benmanes.caffeine.cache.PD
value, VALUE_OFFSET
-
Fields inherited from interface com.github.benmanes.caffeine.cache.NodeFactory
DEAD_STRONG_KEY, DEAD_WEAK_KEY, RETIRED_STRONG_KEY, RETIRED_WEAK_KEY
-
-
Constructor Summary
Constructors Constructor Description PDR()PDR(java.lang.Object keyReference, V value, java.lang.ref.ReferenceQueue<V> valueReferenceQueue, int weight, long now)PDR(K key, java.lang.ref.ReferenceQueue<K> keyReferenceQueue, V value, java.lang.ref.ReferenceQueue<V> valueReferenceQueue, int weight, long now)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancasWriteTime(long expect, long update)Atomically sets the write time to the given updated value if the current value equals the expected value and returns if the update was successful.longgetWriteTime()Returns the time that this entry was last written, in ns.Node<K,V>newNode(java.lang.Object keyReference, V value, java.lang.ref.ReferenceQueue<V> valueReferenceQueue, int weight, long now)Returns a node optimized for the specified features.Node<K,V>newNode(K key, java.lang.ref.ReferenceQueue<K> keyReferenceQueue, V value, java.lang.ref.ReferenceQueue<V> valueReferenceQueue, int weight, long now)Returns a node optimized for the specified features.voidsetWriteTime(long writeTime)Sets the write time in nanoseconds.-
Methods inherited from class com.github.benmanes.caffeine.cache.PD
containsValue, die, getKey, getKeyReference, getValue, getValueReference, isAlive, isDead, isRetired, retire, setValue, softValues
-
Methods inherited from class com.github.benmanes.caffeine.cache.Node
casVariableTime, getAccessTime, getNextInAccessOrder, getNextInVariableOrder, getNextInWriteOrder, getPolicyWeight, getPreviousInAccessOrder, getPreviousInVariableOrder, getPreviousInWriteOrder, getQueueType, getVariableTime, getWeight, inMainProbation, inMainProtected, inWindow, makeMainProbation, makeMainProtected, makeWindow, setAccessTime, setNextInAccessOrder, setNextInVariableOrder, setNextInWriteOrder, setPolicyWeight, setPreviousInAccessOrder, setPreviousInVariableOrder, setPreviousInWriteOrder, setQueueType, setVariableTime, setWeight, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.github.benmanes.caffeine.cache.NodeFactory
newLookupKey, newReferenceKey, weakValues
-
-
-
-
Method Detail
-
getWriteTime
public final long getWriteTime()
Description copied from class:NodeReturns the time that this entry was last written, in ns.- Overrides:
getWriteTimein classNode<K,V>
-
setWriteTime
public final void setWriteTime(long writeTime)
Description copied from class:NodeSets the write time in nanoseconds. This update may be set lazily and rely on the memory fence when the lock is released.- Overrides:
setWriteTimein classNode<K,V>
-
casWriteTime
public final boolean casWriteTime(long expect, long update)Description copied from class:NodeAtomically sets the write time to the given updated value if the current value equals the expected value and returns if the update was successful.- Overrides:
casWriteTimein classNode<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:NodeFactoryReturns a node optimized for the specified features.
-
-