|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hive.ql.exec.persistence.HashMapWrapper<K,V>
public class HashMapWrapper<K,V>
Simple wrapper for persistent Hashmap implementing only the put/get/remove/clear interface. The main memory hash table acts as a cache and all put/get will operate on it first. If the size of the main memory hash table exceeds a certain threshold, new elements will go into the persistent hash table.
Field Summary | |
---|---|
protected org.apache.commons.logging.Log |
LOG
|
Constructor Summary | |
---|---|
HashMapWrapper()
|
|
HashMapWrapper(int threshold)
Constructor. |
Method Summary | |
---|---|
int |
cacheSize()
Get the main memory cache capacity. |
void |
clear()
Clean up the hash table. |
void |
close()
Close the persistent hash table and clean it up. |
V |
get(K key)
Get the value based on the key. |
Set<K> |
keySet()
Get a list of all keys in the hash map. |
void |
put(K key,
V value)
Put the key value pair in the hash table. |
void |
remove(Object key)
Remove one key-value pairs from the hash table based on the given key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.apache.commons.logging.Log LOG
Constructor Detail |
---|
public HashMapWrapper(int threshold)
threshold
- User specified threshold to store new values into persistent storage.public HashMapWrapper()
Method Detail |
---|
public V get(K key) throws HiveException
key
-
HiveException
public void put(K key, V value) throws HiveException
key
- value
-
HiveException
public void clear() throws HiveException
HiveException
public void remove(Object key) throws HiveException
key
-
HiveException
public Set<K> keySet()
public int cacheSize()
public void close() throws HiveException
HiveException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |