Class TimerWheel.Sentinel<K,V>
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.Node<K,V>
-
- com.github.benmanes.caffeine.cache.TimerWheel.Sentinel<K,V>
-
- All Implemented Interfaces:
AccessOrderDeque.AccessOrder<Node<K,V>>
,WriteOrderDeque.WriteOrder<Node<K,V>>
- Enclosing class:
- TimerWheel<K,V>
static final class TimerWheel.Sentinel<K,V> extends Node<K,V>
A sentinel for the doubly-linked list in the bucket.
-
-
Constructor Summary
Constructors Constructor Description Sentinel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsValue(java.lang.Object value)
Returnstrue
if the given objects are considered equivalent.void
die()
Sets the node to the dead state.@Nullable K
getKey()
Return the key ornull
if it has been reclaimed by the garbage collector.java.lang.Object
getKeyReference()
Returns the reference that the cache is holding the entry by.Node<K,V>
getNextInVariableOrder()
Node<K,V>
getPreviousInVariableOrder()
@Nullable V
getValue()
Return the value ornull
if it has been reclaimed by the garbage collector.java.lang.Object
getValueReference()
Returns the reference to the value.boolean
isAlive()
If the entry is available in the hash-table and page replacement policy.boolean
isDead()
If the entry was removed from the hash-table and the page replacement policy.boolean
isRetired()
If the entry was removed from the hash-table and is awaiting removal from the page replacement policy.void
retire()
Sets the node to the retired state.void
setNextInVariableOrder(@Nullable Node<K,V> next)
void
setPreviousInVariableOrder(@Nullable Node<K,V> prev)
void
setValue(V value, @Nullable java.lang.ref.ReferenceQueue<V> referenceQueue)
Sets the value, which may be held strongly, weakly, or softly.-
Methods inherited from class com.github.benmanes.caffeine.cache.Node
casVariableTime, casWriteTime, getAccessTime, getNextInAccessOrder, getNextInWriteOrder, getPolicyWeight, getPreviousInAccessOrder, getPreviousInWriteOrder, getQueueType, getVariableTime, getWeight, getWriteTime, inMainProbation, inMainProtected, inWindow, makeMainProbation, makeMainProtected, makeWindow, setAccessTime, setNextInAccessOrder, setNextInWriteOrder, setPolicyWeight, setPreviousInAccessOrder, setPreviousInWriteOrder, setQueueType, setVariableTime, setWeight, setWriteTime, toString
-
-
-
-
Method Detail
-
getPreviousInVariableOrder
public Node<K,V> getPreviousInVariableOrder()
- Overrides:
getPreviousInVariableOrder
in classNode<K,V>
-
setPreviousInVariableOrder
public void setPreviousInVariableOrder(@Nullable Node<K,V> prev)
- Overrides:
setPreviousInVariableOrder
in classNode<K,V>
-
getNextInVariableOrder
public Node<K,V> getNextInVariableOrder()
- Overrides:
getNextInVariableOrder
in classNode<K,V>
-
setNextInVariableOrder
public void setNextInVariableOrder(@Nullable Node<K,V> next)
- Overrides:
setNextInVariableOrder
in classNode<K,V>
-
getKey
public @Nullable K getKey()
Description copied from class:Node
Return the key ornull
if it has been reclaimed by the garbage collector.
-
getKeyReference
public java.lang.Object getKeyReference()
Description copied from class:Node
Returns the reference that the cache is holding the entry by. This is either the key if strongly held or aWeakReference
to that key.- Specified by:
getKeyReference
in classNode<K,V>
-
getValue
public @Nullable V getValue()
Description copied from class:Node
Return the value ornull
if it has been reclaimed by the garbage collector.
-
getValueReference
public java.lang.Object getValueReference()
Description copied from class:Node
Returns the reference to the value. This is either the value if strongly held or aReference
to that value.- Specified by:
getValueReference
in classNode<K,V>
-
setValue
public void setValue(V value, @Nullable java.lang.ref.ReferenceQueue<V> referenceQueue)
Description copied from class:Node
Sets the value, which may be held strongly, weakly, or softly. This update may be set lazily and rely on the memory fence when the lock is released.
-
containsValue
public boolean containsValue(java.lang.Object value)
Description copied from class:Node
Returnstrue
if the given objects are considered equivalent. A strongly held value is compared by equality and a weakly or softly held value is compared by identity.- Specified by:
containsValue
in classNode<K,V>
-
isAlive
public boolean isAlive()
Description copied from class:Node
If the entry is available in the hash-table and page replacement policy.
-
isRetired
public boolean isRetired()
Description copied from class:Node
If the entry was removed from the hash-table and is awaiting removal from the page replacement policy.
-
isDead
public boolean isDead()
Description copied from class:Node
If the entry was removed from the hash-table and the page replacement policy.
-
retire
public void retire()
Description copied from class:Node
Sets the node to the retired state.
-
-