|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvoldemort.store.memory.InMemoryStorageEngine<K,V>
public class InMemoryStorageEngine<K,V>
A simple non-persistent, in-memory store. Useful for unit testing.
| Constructor Summary | |
|---|---|
InMemoryStorageEngine(java.lang.String name)
|
|
InMemoryStorageEngine(java.lang.String name,
java.util.concurrent.ConcurrentMap<K,java.util.List<Versioned<V>>> map)
|
|
| Method Summary | |
|---|---|
void |
close()
Close the store. |
boolean |
delete(K key)
|
boolean |
delete(K key,
Version version)
Delete all entries prior to the given version |
void |
deleteAll()
|
ClosableIterator<Pair<K,Versioned<V>>> |
entries()
Get an iterator over pairs of entries in the store. |
java.util.List<Versioned<V>> |
get(K key)
Get the value associated with the given key |
java.util.Map<K,java.util.List<Versioned<V>>> |
getAll(java.lang.Iterable<K> keys)
Get the values associated with the given keys and returns them in a Map of keys to a list of versioned values. |
java.lang.Object |
getCapability(StoreCapabilityType capability)
Get some capability of the store. |
java.lang.String |
getName()
|
java.util.List<Version> |
getVersions(K key)
|
ClosableIterator<K> |
keys()
Get an iterator over keys in the store. |
void |
put(K key,
Versioned<V> value)
Associate the value with the key and version in this store |
java.lang.String |
toString()
|
java.lang.String |
toString(int size)
|
void |
truncate()
Truncate all entries in the store |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public InMemoryStorageEngine(java.lang.String name)
public InMemoryStorageEngine(java.lang.String name,
java.util.concurrent.ConcurrentMap<K,java.util.List<Versioned<V>>> map)
| Method Detail |
|---|
public void close()
Store
close in interface Store<K,V>public void deleteAll()
public boolean delete(K key)
public boolean delete(K key,
Version version)
Store
delete in interface Store<K,V>key - The key to deleteversion - The current value of the key
public java.util.List<Version> getVersions(K key)
getVersions in interface Store<K,V>
public java.util.List<Versioned<V>> get(K key)
throws VoldemortException
Store
get in interface Store<K,V>key - The key to check for
VoldemortException
public java.util.Map<K,java.util.List<Versioned<V>>> getAll(java.lang.Iterable<K> keys)
throws VoldemortException
Store
getAll in interface Store<K,V>keys - The keys to check for.
VoldemortException
public void put(K key,
Versioned<V> value)
throws VoldemortException
Store
put in interface Store<K,V>key - The key to usevalue - The value to store and its version.
VoldemortExceptionpublic java.lang.Object getCapability(StoreCapabilityType capability)
Store
getCapability in interface Store<K,V>capability - The capability type to retrieve
public ClosableIterator<Pair<K,Versioned<V>>> entries()
StorageEngine
entries in interface StorageEngine<K,V>public ClosableIterator<K> keys()
StorageEngine
keys in interface StorageEngine<K,V>public void truncate()
StorageEngine
truncate in interface StorageEngine<K,V>public java.lang.String getName()
getName in interface Store<K,V>public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(int size)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||