|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.regionserver.LruHashMap.Entry<K,V>
protected static class LruHashMap.Entry<K extends HeapSize,V extends HeapSize>
Entry to store key/value mappings.
Contains previous and next pointers for the doubly linked-list which is used for LRU eviction.
Instantiations of this class are memory aware. Both the key and value
classes used must also implement HeapSize
.
Field Summary | |
---|---|
protected int |
hash
The hash value for this entries key |
protected long |
heapSize
The precomputed heap size of this entry |
protected K |
key
The key |
protected LruHashMap.Entry<K,V> |
next
The next entry in the hash chain (for collisions) |
protected LruHashMap.Entry<K,V> |
nextPtr
The next entry in the LRU list (towards MRU) |
protected LruHashMap.Entry<K,V> |
prevPtr
The previous entry in the LRU list (towards LRU) |
protected V |
value
The value |
Method Summary | |
---|---|
boolean |
equals(Object o)
Returns true is the specified entry has the same key and the same value as this entry. |
K |
getKey()
Get the key of this entry. |
protected LruHashMap.Entry<K,V> |
getNextPtr()
Returns the next pointer for the entry in teh LRU. |
protected LruHashMap.Entry<K,V> |
getPrevPtr()
Returns the previous pointer for the entry in the LRU. |
V |
getValue()
Get the value of this entry. |
int |
hashCode()
Returns the hash code of the entry by xor'ing the hash values of the key and value of this entry. |
long |
heapSize()
Returns the pre-computed and "deep" size of the Entry |
protected long |
replaceValue(V newValue)
Replace the value of this entry. |
protected void |
setNextPtr(LruHashMap.Entry<K,V> nextPtr)
Sets the next pointer for the entry in the LRU. |
protected void |
setPrevPtr(LruHashMap.Entry<K,V> prevPtr)
Sets the previous pointer for the entry in the LRU. |
V |
setValue(V newValue)
Set the value of this entry. |
String |
toString()
Returns String representation of the entry in form "key=value" |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final K extends HeapSize key
protected V extends HeapSize value
protected final int hash
protected LruHashMap.Entry<K extends HeapSize,V extends HeapSize> next
protected LruHashMap.Entry<K extends HeapSize,V extends HeapSize> prevPtr
protected LruHashMap.Entry<K extends HeapSize,V extends HeapSize> nextPtr
protected long heapSize
Method Detail |
---|
public K getKey()
getKey
in interface Map.Entry<K extends HeapSize,V extends HeapSize>
public V getValue()
getValue
in interface Map.Entry<K extends HeapSize,V extends HeapSize>
public V setValue(V newValue)
replaceValue
will return the difference
in heap usage between the previous and current values.
setValue
in interface Map.Entry<K extends HeapSize,V extends HeapSize>
newValue
- the new value to associate with this entry
protected long replaceValue(V newValue)
newValue
- the new value to associate with this entry
public boolean equals(Object o)
equals
in interface Map.Entry<K extends HeapSize,V extends HeapSize>
equals
in class Object
o
- entry to test against current
public int hashCode()
hashCode
in interface Map.Entry<K extends HeapSize,V extends HeapSize>
hashCode
in class Object
public String toString()
toString
in class Object
protected void setPrevPtr(LruHashMap.Entry<K,V> prevPtr)
prevPtr
- previous entryprotected LruHashMap.Entry<K,V> getPrevPtr()
protected void setNextPtr(LruHashMap.Entry<K,V> nextPtr)
nextPtr
- next entryprotected LruHashMap.Entry<K,V> getNextPtr()
public long heapSize()
heapSize
in interface HeapSize
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |