Package org.h2.mvstore.cache
Class CacheLongKeyLIRS.Entry<V>
- java.lang.Object
-
- org.h2.mvstore.cache.CacheLongKeyLIRS.Entry<V>
-
- Type Parameters:
V
- the value type
- Enclosing class:
- CacheLongKeyLIRS<V>
static class CacheLongKeyLIRS.Entry<V> extends java.lang.Object
A cache entry. Each entry is either hot (low inter-reference recency; LIR), cold (high inter-reference recency; HIR), or non-resident-cold. Hot entries are in the stack only. Cold entries are in the queue, and may be in the stack. Non-resident-cold entries have their value set to null and are in the stack and in the non-resident queue.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) long
key
The key.(package private) CacheLongKeyLIRS.Entry<V>
mapNext
The next entry in the map (the chained entry).(package private) int
memory
The estimated memory used.(package private) CacheLongKeyLIRS.Entry<V>
queueNext
The next entry in the queue (either the resident queue or the non-resident queue).(package private) CacheLongKeyLIRS.Entry<V>
queuePrev
The previous entry in the queue.(package private) java.lang.ref.WeakReference<V>
reference
Weak reference to the value.(package private) CacheLongKeyLIRS.Entry<V>
stackNext
The next entry in the stack.(package private) CacheLongKeyLIRS.Entry<V>
stackPrev
The previous entry in the stack.(package private) int
topMove
When the item was last moved to the top of the stack.(package private) V
value
The value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) int
getMemory()
(package private) V
getValue()
(package private) boolean
isHot()
Whether this entry is hot.
-
-
-
Field Detail
-
key
final long key
The key.
-
value
V value
The value. Set to null for non-resident-cold entries.
-
reference
java.lang.ref.WeakReference<V> reference
Weak reference to the value. Set to null for resident entries.
-
memory
final int memory
The estimated memory used.
-
topMove
int topMove
When the item was last moved to the top of the stack.
-
stackNext
CacheLongKeyLIRS.Entry<V> stackNext
The next entry in the stack.
-
stackPrev
CacheLongKeyLIRS.Entry<V> stackPrev
The previous entry in the stack.
-
queueNext
CacheLongKeyLIRS.Entry<V> queueNext
The next entry in the queue (either the resident queue or the non-resident queue).
-
queuePrev
CacheLongKeyLIRS.Entry<V> queuePrev
The previous entry in the queue.
-
mapNext
CacheLongKeyLIRS.Entry<V> mapNext
The next entry in the map (the chained entry).
-
-
Constructor Detail
-
Entry
Entry()
-
Entry
Entry(long key, V value, int memory)
-
Entry
Entry(CacheLongKeyLIRS.Entry<V> old)
-
-
Method Detail
-
isHot
boolean isHot()
Whether this entry is hot. Cold entries are in one of the two queues.- Returns:
- whether the entry is hot
-
getValue
V getValue()
-
getMemory
int getMemory()
-
-