|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.regionserver.wal.LRUDictionary
@InterfaceAudience.Private public class LRUDictionary
WALDictionary using an LRU eviction algorithm. Uses a linked list running
through a hashtable. Currently has max of 2^15 entries. Will start
evicting if exceeds this number The maximum memory we expect this dictionary
to take in the worst case is about:
(2 ^ 15) * 5 (Regionname, Row key, CF, Column qual, table) * 100 bytes (these are some big names) = ~16MB.
If you want to get silly, even at 1kb entries, it maxes out at 160 megabytes.
| Field Summary | |
|---|---|
static byte |
NOT_IN_DICTIONARY
|
| Constructor Summary | |
|---|---|
LRUDictionary()
|
|
| Method Summary | |
|---|---|
short |
addEntry(byte[] data,
int offset,
int length)
Adds an entry to the dictionary. |
void |
clear()
Flushes the dictionary, empties all values. |
short |
findEntry(byte[] data,
int offset,
int length)
Finds the index of an entry. |
byte[] |
getEntry(short idx)
Gets an entry from the dictionary. |
void |
init(int initialSize)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final byte NOT_IN_DICTIONARY
| Constructor Detail |
|---|
public LRUDictionary()
| Method Detail |
|---|
public byte[] getEntry(short idx)
idx - index of the entry
public void init(int initialSize)
public short findEntry(byte[] data,
int offset,
int length)
data - the byte array that we're looking upoffset - Offset into data to add to Dictionary.length - Length beyond offset that comprises entry; must be > 0.
NOT_IN_DICTIONARY if not found
public short addEntry(byte[] data,
int offset,
int length)
findEntry(byte[], int, int)} to add without duplicating
dictionary entries.
data - the entry to addoffset - Offset into data to add to Dictionary.length - Length beyond offset that comprises entry; must be > 0.
public void clear()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||