Class FSAW<K,V>
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.Node<K,V>
-
- com.github.benmanes.caffeine.cache.FS<K,V>
-
- com.github.benmanes.caffeine.cache.FSA<K,V>
-
- com.github.benmanes.caffeine.cache.FSAW<K,V>
-
- All Implemented Interfaces:
AccessOrderDeque.AccessOrder<Node<K,V>>
,NodeFactory<K,V>
,WriteOrderDeque.WriteOrder<Node<K,V>>
class FSAW<K,V> extends FSA<K,V>
WARNING: GENERATED CODE A cache entry that provides the following features:- ExpireWrite
- WeakKeys (inherited)
- StrongValues (inherited)
- ExpireAccess (inherited)
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Node<K,V>
nextInWriteOrder
(package private) Node<K,V>
previousInWriteOrder
protected static long
WRITE_TIME_OFFSET
(package private) long
writeTime
-
Fields inherited from class com.github.benmanes.caffeine.cache.FSA
ACCESS_TIME_OFFSET, accessTime, nextInAccessOrder, previousInAccessOrder
-
Fields inherited from class com.github.benmanes.caffeine.cache.FS
key, KEY_OFFSET, 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 FSAW()
FSAW(java.lang.Object keyReference, V value, java.lang.ref.ReferenceQueue<V> valueReferenceQueue, int weight, long now)
FSAW(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 boolean
casVariableTime(long expect, long update)
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.Node<K,V>
getNextInVariableOrder()
Node<K,V>
getNextInWriteOrder()
Retrieves the next element or null if either the element is unlinked or the last element on the deque.Node<K,V>
getPreviousInVariableOrder()
Node<K,V>
getPreviousInWriteOrder()
Retrieves the previous element or null if either the element is unlinked or the first element on the deque.long
getVariableTime()
Returns the variable expiration time, in nanoseconds.long
getWriteTime()
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.void
setNextInVariableOrder(Node<K,V> nextInWriteOrder)
void
setNextInWriteOrder(Node<K,V> nextInWriteOrder)
Sets the next element or null if there is no link.void
setPreviousInVariableOrder(Node<K,V> previousInWriteOrder)
void
setPreviousInWriteOrder(Node<K,V> previousInWriteOrder)
Sets the previous element or null if there is no link.void
setVariableTime(long writeTime)
Sets the variable expiration time in nanoseconds.void
setWriteTime(long writeTime)
Sets the write time in nanoseconds.-
Methods inherited from class com.github.benmanes.caffeine.cache.FSA
getAccessTime, getNextInAccessOrder, getPreviousInAccessOrder, setAccessTime, setNextInAccessOrder, setPreviousInAccessOrder
-
Methods inherited from class com.github.benmanes.caffeine.cache.FS
containsValue, die, getKey, getKeyReference, getValue, getValueReference, isAlive, isDead, isRetired, newLookupKey, newReferenceKey, retire, setValue
-
Methods inherited from class com.github.benmanes.caffeine.cache.Node
casWriteTime, getPolicyWeight, getQueueType, getWeight, inMainProbation, inMainProtected, inWindow, makeMainProbation, makeMainProtected, makeWindow, setPolicyWeight, setQueueType, 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
softValues, weakValues
-
-
-
-
Method Detail
-
getPreviousInVariableOrder
public Node<K,V> getPreviousInVariableOrder()
- Overrides:
getPreviousInVariableOrder
in classFSA<K,V>
-
setPreviousInVariableOrder
public void setPreviousInVariableOrder(Node<K,V> previousInWriteOrder)
- Overrides:
setPreviousInVariableOrder
in classFSA<K,V>
-
getNextInVariableOrder
public Node<K,V> getNextInVariableOrder()
- Overrides:
getNextInVariableOrder
in classFSA<K,V>
-
setNextInVariableOrder
public void setNextInVariableOrder(Node<K,V> nextInWriteOrder)
- Overrides:
setNextInVariableOrder
in classFSA<K,V>
-
getVariableTime
public long getVariableTime()
Description copied from class:Node
Returns the variable expiration time, in nanoseconds.- Overrides:
getVariableTime
in classFSA<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 classFSA<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 classFSA<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 classNode<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 classNode<K,V>
-
getPreviousInWriteOrder
public final Node<K,V> getPreviousInWriteOrder()
Description copied from interface:WriteOrderDeque.WriteOrder
Retrieves the previous element or null if either the element is unlinked or the first element on the deque.- Specified by:
getPreviousInWriteOrder
in interfaceWriteOrderDeque.WriteOrder<K>
- Overrides:
getPreviousInWriteOrder
in classNode<K,V>
-
setPreviousInWriteOrder
public final void setPreviousInWriteOrder(Node<K,V> previousInWriteOrder)
Description copied from interface:WriteOrderDeque.WriteOrder
Sets the previous element or null if there is no link.- Specified by:
setPreviousInWriteOrder
in interfaceWriteOrderDeque.WriteOrder<K>
- Overrides:
setPreviousInWriteOrder
in classNode<K,V>
-
getNextInWriteOrder
public final Node<K,V> getNextInWriteOrder()
Description copied from interface:WriteOrderDeque.WriteOrder
Retrieves the next element or null if either the element is unlinked or the last element on the deque.- Specified by:
getNextInWriteOrder
in interfaceWriteOrderDeque.WriteOrder<K>
- Overrides:
getNextInWriteOrder
in classNode<K,V>
-
setNextInWriteOrder
public final void setNextInWriteOrder(Node<K,V> nextInWriteOrder)
Description copied from interface:WriteOrderDeque.WriteOrder
Sets the next element or null if there is no link.- Specified by:
setNextInWriteOrder
in interfaceWriteOrderDeque.WriteOrder<K>
- Overrides:
setNextInWriteOrder
in 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:NodeFactory
Returns a node optimized for the specified features.
-
-