|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Dictionary<K,V>
java.util.Hashtable<K,V>
voldemort.utils.WriteThroughCache<K,V>
public abstract class WriteThroughCache<K,V>
Extends Java HashMap HashMap
as a Write through cache
provide a hook to write custom write back strategies
Constructor Summary | |
---|---|
WriteThroughCache()
|
Method Summary | |
---|---|
V |
get(java.lang.Object key)
get() calls the readBack function if the value is not in HashMap otherwise serve copy from hash directly. |
V |
put(K key,
V value)
Updates the value in HashMap and writeBack as Atomic step |
abstract V |
readBack(K key)
|
abstract void |
writeBack(K key,
V value)
|
Methods inherited from class java.util.Hashtable |
---|
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, hashCode, isEmpty, keys, keySet, putAll, rehash, remove, size, toString, values |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WriteThroughCache()
Method Detail |
---|
public abstract V readBack(K key)
public abstract void writeBack(K key, V value)
public V get(java.lang.Object key)
get
in interface java.util.Map<K,V>
get
in class java.util.Hashtable<K,V>
public V put(K key, V value)
put
in interface java.util.Map<K,V>
put
in class java.util.Hashtable<K,V>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |