public class ReplicatedDataStore<K,V extends Serializable> extends Object implements DataStore<K,V>
| Constructor and Description |
|---|
ReplicatedDataStore(DataStoreContext<K,V> conf,
GroupService gs) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this datastore.
|
void |
destroy() |
V |
get(K key)
Returns the value to which the specified key is mapped in this cache.
|
DataStoreContext<K,V> |
getDataStoreContext() |
String |
put(K k,
V v)
Creates or Replaces the object associated with key k.
|
void |
remove(K k)
Removes the mapping between the key and the object.
|
int |
removeIdleEntries(long idleFor)
Removes all entries that were not accessed for more than 'idlefor' millis
|
int |
size() |
String |
touch(K k,
long version,
long ts,
long ttl)
Updates the timestamp associated with this entry.
|
public ReplicatedDataStore(DataStoreContext<K,V> conf, GroupService gs)
public DataStoreContext<K,V> getDataStoreContext()
public String put(K k, V v) throws DataStoreException
DataStoreput in interface DataStore<K,V extends Serializable>k - The Keyv - The value. The value must be either serializable of the DataStoreEntryHelper
that is associated with this cache must be able to transform this into a serializable.DataStoreExceptionpublic V get(K key) throws DataStoreException
DataStoreget in interface DataStore<K,V extends Serializable>key - The keyDataStoreExceptionpublic void remove(K k) throws DataStoreException
DataStoreremove in interface DataStore<K,V extends Serializable>k - The keyDataStoreExceptionpublic String touch(K k, long version, long ts, long ttl) throws DataStoreException
DataStoretouch in interface DataStore<K,V extends Serializable>k - The keyDataStoreExceptionpublic int removeIdleEntries(long idleFor)
DataStoreremoveIdleEntries in interface DataStore<K,V extends Serializable>idleFor - Time in milli secondspublic void close()
DataStoreclose in interface DataStore<K,V extends Serializable>public void destroy()
destroy in interface DataStore<K,V extends Serializable>public int size()
size in interface DataStore<K,V extends Serializable>Copyright © 2017–2019 Eclipse Foundation. All rights reserved.