|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sdnplatform.sync.internal.store.InMemoryStorageEngine<K,V>
public class InMemoryStorageEngine<K,V>
A simple non-persistent, in-memory store.
| Field Summary | |
|---|---|
protected int |
tombstoneDeletion
Interval in milliseconds before tombstones will be cleared. |
| 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 |
cleanupTask()
Perform any periodic cleanup tasks that might need to be performed. |
void |
close()
Close the store. |
boolean |
containsKey(K key)
Check whether the given key is present in the store |
boolean |
doput(K key,
Versioned<V> value)
|
IClosableIterator<java.util.Map.Entry<K,java.util.List<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.lang.String |
getName()
|
java.util.List<IVersion> |
getVersions(K key)
Get a list of the versions associated with the given key |
boolean |
isPersistent()
Returns true if the underlying data store is persistent |
IClosableIterator<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.util.List<Versioned<V>> |
remove(K key)
Atomically remove the key and return the value that was mapped to it, if any |
void |
setTombstoneInterval(int interval)
Set the interval after which tombstones will be cleaned up. |
int |
size()
Get the number of keys currently in the store |
java.lang.String |
toString()
|
protected java.lang.String |
toString(int size)
|
void |
truncate()
Truncate all entries in the store. |
boolean |
writeSyncValue(K key,
java.lang.Iterable<Versioned<V>> values)
Write the given versioned values into the given key. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int tombstoneDeletion
| 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()
IStore
close in interface IStore<K,V>
public java.util.List<IVersion> getVersions(K key)
throws SyncException
IStore
getVersions in interface IStore<K,V>key - the key
IVersion objects
SyncException
public java.util.List<Versioned<V>> get(K key)
throws SyncException
IStore
get in interface IStore<K,V>key - The key to check for
SyncException
public void put(K key,
Versioned<V> value)
throws SyncException
IStore
put in interface IStore<K,V>key - The key to usevalue - The value to store and its version.
SyncException
public boolean doput(K key,
Versioned<V> value)
throws SyncException
SyncExceptionpublic IClosableIterator<java.util.Map.Entry<K,java.util.List<Versioned<V>>>> entries()
IStorageEngine
entries in interface IStorageEngine<K,V>entries in interface IStore<K,V>public IClosableIterator<K> keys()
IStorageEngine
keys in interface IStorageEngine<K,V>public void truncate()
IStorageEngine
truncate in interface IStorageEngine<K,V>public java.lang.String getName()
getName in interface IStore<K,V>
public boolean writeSyncValue(K key,
java.lang.Iterable<Versioned<V>> values)
IStorageEngine
writeSyncValue in interface IStorageEngine<K,V>key - the keyvalues - the list of versions for that key
public void cleanupTask()
IStorageEngine
cleanupTask in interface IStorageEngine<K,V>public boolean isPersistent()
IStorageEngine
isPersistent in interface IStorageEngine<K,V>public void setTombstoneInterval(int interval)
IStorageEngine
setTombstoneInterval in interface IStorageEngine<K,V>interval - the interval in millisecondspublic int size()
public java.util.List<Versioned<V>> remove(K key)
key - the key to remove
public boolean containsKey(K key)
key - the key
true if the key is presentpublic java.lang.String toString()
toString in class java.lang.Objectprotected java.lang.String toString(int size)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||