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>
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
FieldsModifier and TypeFieldDescription(package private) final long
The key.(package private) CacheLongKeyLIRS.Entry
<V> The next entry in the map (the chained entry).(package private) final int
The estimated memory used.(package private) CacheLongKeyLIRS.Entry
<V> The next entry in the queue (either the resident queue or the non-resident queue).(package private) CacheLongKeyLIRS.Entry
<V> The previous entry in the queue.(package private) WeakReference
<V> Weak reference to the value.(package private) CacheLongKeyLIRS.Entry
<V> The next entry in the stack.(package private) CacheLongKeyLIRS.Entry
<V> The previous entry in the stack.(package private) int
When the item was last moved to the top of the stack.(package private) V
The value. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
key
final long keyThe key. -
value
V valueThe value. Set to null for non-resident-cold entries. -
reference
WeakReference<V> referenceWeak reference to the value. Set to null for resident entries. -
memory
final int memoryThe estimated memory used. -
topMove
int topMoveWhen the item was last moved to the top of the stack. -
stackNext
CacheLongKeyLIRS.Entry<V> stackNextThe next entry in the stack. -
stackPrev
CacheLongKeyLIRS.Entry<V> stackPrevThe previous entry in the stack. -
queueNext
CacheLongKeyLIRS.Entry<V> queueNextThe next entry in the queue (either the resident queue or the non-resident queue). -
queuePrev
CacheLongKeyLIRS.Entry<V> queuePrevThe previous entry in the queue. -
mapNext
CacheLongKeyLIRS.Entry<V> mapNextThe next entry in the map (the chained entry).
-
-
Constructor Details
-
Entry
Entry() -
Entry
Entry(long key, V value, int memory) -
Entry
Entry(CacheLongKeyLIRS.Entry<V> old)
-
-
Method Details
-
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()
-