Interface Node<K,V>
- All Superinterfaces:
AccessOrderDeque.AccessOrder<Node<K,
,V>> WriteOrderDeque.WriteOrder<Node<K,
V>>
- All Known Implementing Classes:
NodeFactory.SSo
,NodeFactory.SSoA
,NodeFactory.SSoAMS
,NodeFactory.SSoAMW
,NodeFactory.SSoAR
,NodeFactory.SSoARMS
,NodeFactory.SSoARMW
,NodeFactory.SSoAW
,NodeFactory.SSoAWMS
,NodeFactory.SSoAWMW
,NodeFactory.SSoAWR
,NodeFactory.SSoAWRMS
,NodeFactory.SSoAWRMW
,NodeFactory.SSoMS
,NodeFactory.SSoMW
,NodeFactory.SSoR
,NodeFactory.SSoRMS
,NodeFactory.SSoRMW
,NodeFactory.SSoW
,NodeFactory.SSoWMS
,NodeFactory.SSoWMW
,NodeFactory.SSoWR
,NodeFactory.SSoWRMS
,NodeFactory.SSoWRMW
,NodeFactory.SSt
,NodeFactory.SStA
,NodeFactory.SStAMS
,NodeFactory.SStAMW
,NodeFactory.SStAR
,NodeFactory.SStARMS
,NodeFactory.SStARMW
,NodeFactory.SStAW
,NodeFactory.SStAWMS
,NodeFactory.SStAWMW
,NodeFactory.SStAWR
,NodeFactory.SStAWRMS
,NodeFactory.SStAWRMW
,NodeFactory.SStMS
,NodeFactory.SStMW
,NodeFactory.SStR
,NodeFactory.SStRMS
,NodeFactory.SStRMW
,NodeFactory.SStW
,NodeFactory.SStWMS
,NodeFactory.SStWMW
,NodeFactory.SStWR
,NodeFactory.SStWRMS
,NodeFactory.SStWRMW
,NodeFactory.SW
,NodeFactory.SWA
,NodeFactory.SWAMS
,NodeFactory.SWAMW
,NodeFactory.SWAR
,NodeFactory.SWARMS
,NodeFactory.SWARMW
,NodeFactory.SWAW
,NodeFactory.SWAWMS
,NodeFactory.SWAWMW
,NodeFactory.SWAWR
,NodeFactory.SWAWRMS
,NodeFactory.SWAWRMW
,NodeFactory.SWMS
,NodeFactory.SWMW
,NodeFactory.SWR
,NodeFactory.SWRMS
,NodeFactory.SWRMW
,NodeFactory.SWW
,NodeFactory.SWWMS
,NodeFactory.SWWMW
,NodeFactory.SWWR
,NodeFactory.SWWRMS
,NodeFactory.SWWRMW
,NodeFactory.WSo
,NodeFactory.WSoA
,NodeFactory.WSoAMS
,NodeFactory.WSoAMW
,NodeFactory.WSoAR
,NodeFactory.WSoARMS
,NodeFactory.WSoARMW
,NodeFactory.WSoAW
,NodeFactory.WSoAWMS
,NodeFactory.WSoAWMW
,NodeFactory.WSoAWR
,NodeFactory.WSoAWRMS
,NodeFactory.WSoAWRMW
,NodeFactory.WSoMS
,NodeFactory.WSoMW
,NodeFactory.WSoR
,NodeFactory.WSoRMS
,NodeFactory.WSoRMW
,NodeFactory.WSoW
,NodeFactory.WSoWMS
,NodeFactory.WSoWMW
,NodeFactory.WSoWR
,NodeFactory.WSoWRMS
,NodeFactory.WSoWRMW
,NodeFactory.WSt
,NodeFactory.WStA
,NodeFactory.WStAMS
,NodeFactory.WStAMW
,NodeFactory.WStAR
,NodeFactory.WStARMS
,NodeFactory.WStARMW
,NodeFactory.WStAW
,NodeFactory.WStAWMS
,NodeFactory.WStAWMW
,NodeFactory.WStAWR
,NodeFactory.WStAWRMS
,NodeFactory.WStAWRMW
,NodeFactory.WStMS
,NodeFactory.WStMW
,NodeFactory.WStR
,NodeFactory.WStRMS
,NodeFactory.WStRMW
,NodeFactory.WStW
,NodeFactory.WStWMS
,NodeFactory.WStWMW
,NodeFactory.WStWR
,NodeFactory.WStWRMS
,NodeFactory.WStWRMW
,NodeFactory.WW
,NodeFactory.WWA
,NodeFactory.WWAMS
,NodeFactory.WWAMW
,NodeFactory.WWAR
,NodeFactory.WWARMS
,NodeFactory.WWARMW
,NodeFactory.WWAW
,NodeFactory.WWAWMS
,NodeFactory.WWAWMW
,NodeFactory.WWAWR
,NodeFactory.WWAWRMS
,NodeFactory.WWAWRMW
,NodeFactory.WWMS
,NodeFactory.WWMW
,NodeFactory.WWR
,NodeFactory.WWRMS
,NodeFactory.WWRMW
,NodeFactory.WWW
,NodeFactory.WWWMS
,NodeFactory.WWWMW
,NodeFactory.WWWR
,NodeFactory.WWWRMS
,NodeFactory.WWWRMW
interface Node<K,V>
extends AccessOrderDeque.AccessOrder<Node<K,V>>, WriteOrderDeque.WriteOrder<Node<K,V>>
An entry in the cache containing the key, value, weight, access, and write metadata. The key
or value may be held weakly or softly requiring identity comparison.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
casWriteTime
(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.boolean
containsValue
(Object value) Returnstrue
if the given objects are considered equivalent.void
die()
Sets the node to the dead state.default long
Returns the time that this entry was last accessed, in ns.getKey()
Return the key ornull
if it has been reclaimed by the garbage collector.Returns the reference that the cache is holding the entry by.Retrieves the next element or null if either the element is unlinked or the last element on the deque.Retrieves the next element or null if either the element is unlinked or the last element on the deque.default int
Returns the weight of this entry from the policy's perspective.Retrieves the previous element or null if either the element is unlinked or the first element on the deque.Retrieves the previous element or null if either the element is unlinked or the first element on the deque.default int
Returns the queue that the entry's resides in (eden, probation, or protected).getValue()
Return the value ornull
if it has been reclaimed by the garbage collector.Returns the reference to the value.default int
Returns the weight of this entry from the entry's perspective.default long
Returns the time that this entry was last written, in ns.default boolean
inEden()
Returns if the entry is in the Eden or Main space.default boolean
Returns if the entry is in the Main space's probation queue.default boolean
Returns if the entry is in the Main space's protected queue.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
If the entry was removed from the hash-table and is awaiting removal from the page replacement policy.default void
Sets the status to the Main space's probation queue.default void
Sets the status to the Main space's protected queue.void
retire()
Sets the node to the retired state.default void
setAccessTime
(long time) Sets the access time in nanoseconds.default void
setNextInAccessOrder
(Node<K, V> next) Sets the next element or null if there is no link.default void
setNextInWriteOrder
(Node<K, V> next) Sets the next element or null if there is no link.default void
setPolicyWeight
(int weight) Sets the weight from the policy's perspective.default void
setPreviousInAccessOrder
(Node<K, V> prev) Sets the previous element or null if there is no link.default void
setPreviousInWriteOrder
(Node<K, V> prev) Sets the previous element or null if there is no link.default void
setQueueType
(int queueType) Set queue that the entry resides in (eden, probation, or protected).void
setValue
(V value, ReferenceQueue<V> referenceQueue) Sets the value, which may be held strongly, weakly, or softly.default void
setWeight
(int weight) Sets the weight from the entry's perspective.default void
setWriteTime
(long time) Sets the write time in nanoseconds.
-
Field Details
-
EDEN
static final int EDEN- See Also:
-
PROBATION
static final int PROBATION- See Also:
-
PROTECTED
static final int PROTECTED- See Also:
-
-
Method Details
-
getKey
Return the key ornull
if it has been reclaimed by the garbage collector. -
getKeyReference
Returns the reference that the cache is holding the entry by. This is either the key if strongly held or aWeakReference
to that key. -
getValue
Return the value ornull
if it has been reclaimed by the garbage collector. -
getValueReference
Returns the reference to the value. This is either the value if strongly held or aReference
to that value. -
setValue
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
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. -
getWeight
@Nonnegative default int getWeight()Returns the weight of this entry from the entry's perspective. -
setWeight
@Nonnegative default void setWeight(int weight) Sets the weight from the entry's perspective. -
getPolicyWeight
@Nonnegative default int getPolicyWeight()Returns the weight of this entry from the policy's perspective. -
setPolicyWeight
@Nonnegative default void setPolicyWeight(int weight) Sets the weight from the policy's perspective. -
isAlive
boolean isAlive()If the entry is available in the hash-table and page replacement policy. -
isRetired
boolean isRetired()If the entry was removed from the hash-table and is awaiting removal from the page replacement policy. -
isDead
boolean isDead()If the entry was removed from the hash-table and the page replacement policy. -
retire
void retire()Sets the node to the retired state. -
die
void die()Sets the node to the dead state. -
inEden
default boolean inEden()Returns if the entry is in the Eden or Main space. -
inMainProbation
default boolean inMainProbation()Returns if the entry is in the Main space's probation queue. -
inMainProtected
default boolean inMainProtected()Returns if the entry is in the Main space's protected queue. -
makeMainProbation
default void makeMainProbation()Sets the status to the Main space's probation queue. -
makeMainProtected
default void makeMainProtected()Sets the status to the Main space's protected queue. -
getQueueType
default int getQueueType()Returns the queue that the entry's resides in (eden, probation, or protected). -
setQueueType
default void setQueueType(int queueType) Set queue that the entry resides in (eden, probation, or protected). -
getAccessTime
default long getAccessTime()Returns the time that this entry was last accessed, in ns. -
setAccessTime
default void setAccessTime(long time) Sets the access time in nanoseconds. This update may be set lazily and rely on the memory fence when the lock is released. -
getPreviousInAccessOrder
Description copied from interface:AccessOrderDeque.AccessOrder
Retrieves the previous element or null if either the element is unlinked or the first element on the deque.- Specified by:
getPreviousInAccessOrder
in interfaceAccessOrderDeque.AccessOrder<K>
-
setPreviousInAccessOrder
Description copied from interface:AccessOrderDeque.AccessOrder
Sets the previous element or null if there is no link.- Specified by:
setPreviousInAccessOrder
in interfaceAccessOrderDeque.AccessOrder<K>
-
getNextInAccessOrder
Description copied from interface:AccessOrderDeque.AccessOrder
Retrieves the next element or null if either the element is unlinked or the last element on the deque.- Specified by:
getNextInAccessOrder
in interfaceAccessOrderDeque.AccessOrder<K>
-
setNextInAccessOrder
Description copied from interface:AccessOrderDeque.AccessOrder
Sets the next element or null if there is no link.- Specified by:
setNextInAccessOrder
in interfaceAccessOrderDeque.AccessOrder<K>
-
getWriteTime
default long getWriteTime()Returns the time that this entry was last written, in ns. -
setWriteTime
default void setWriteTime(long time) Sets the write time in nanoseconds. This update may be set lazily and rely on the memory fence when the lock is released. -
casWriteTime
default boolean casWriteTime(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. -
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>
-
setPreviousInWriteOrder
Description copied from interface:WriteOrderDeque.WriteOrder
Sets the previous element or null if there is no link.- Specified by:
setPreviousInWriteOrder
in interfaceWriteOrderDeque.WriteOrder<K>
-
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>
-
setNextInWriteOrder
Description copied from interface:WriteOrderDeque.WriteOrder
Sets the next element or null if there is no link.- Specified by:
setNextInWriteOrder
in interfaceWriteOrderDeque.WriteOrder<K>
-