|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
K - The type of the key being storedV - The type of the value being storedpublic interface StoreClient<K,V>
The user-facing interface to a Voldemort store. Gives basic put/get/delete plus helper functions.
| Method Summary | |
|---|---|
boolean |
applyUpdate(UpdateAction<K,V> action)
Apply the given action repeatedly until no ObsoleteVersionException is thrown. |
boolean |
applyUpdate(UpdateAction<K,V> action,
int maxTries)
Apply the given action repeatedly until no ObsoleteVersionException is thrown or maxTries unsuccessful attempts have been made. |
boolean |
delete(K key)
Delete any version of the given key which equal to or less than the current versions |
boolean |
delete(K key,
Version version)
Delete the specified version and any prior versions of the given key |
Versioned<V> |
get(K key)
Get the versioned value associated with the given key or null if no value is associated with the key. |
Versioned<V> |
get(K key,
java.lang.Object transforms)
Get the versioned value associated with the given key and apply the given transforms to it before returning the value. |
Versioned<V> |
get(K key,
Versioned<V> defaultValue)
Get the versioned value associated with the given key or the defaultValue if no value is associated with the key. |
java.util.Map<K,Versioned<V>> |
getAll(java.lang.Iterable<K> keys)
Gets the versioned values associated with the given keys and returns them in a Map of keys to versioned values. |
java.util.Map<K,Versioned<V>> |
getAll(java.lang.Iterable<K> keys,
java.util.Map<K,java.lang.Object> transforms)
Like getAll, except
that the transforms are applied on the value associated with each key
before returning the results |
java.util.List<voldemort.cluster.Node> |
getResponsibleNodes(K key)
Returns the list of nodes which should have this key. |
V |
getValue(K key)
Get the value associated with the given key or null if there is no value associated with this key. |
V |
getValue(K key,
V defaultValue)
Get the value associated with the given key or defaultValue if there is no value associated with the key. |
Version |
put(K key,
V value)
Associated the given value to the key, clobbering any existing values stored for the key. |
Version |
put(K key,
Versioned<V> versioned)
Put the given Versioned value into the store for the given key if the version is greater to or concurrent with existing values. |
Version |
put(K key,
V value,
java.lang.Object transforms)
Like #put(Object, Object), except
that the given transforms are applied on the value before writing it to
the store |
boolean |
putIfNotObsolete(K key,
Versioned<V> versioned)
Put the versioned value to the key, ignoring any ObsoleteVersionException that may be thrown |
| Method Detail |
|---|
V getValue(K key)
key - The key
V getValue(K key,
V defaultValue)
key - The key for which to fetch the associated valuedefaultValue - A value to return if there is no value associated
with this key
Versioned<V> get(K key)
key - The key for which to fetch the value.
Versioned<V> get(K key,
java.lang.Object transforms)
key - the key for which the value is fetchedtransforms - the transforms to be applied on the value fetched from
the store
java.util.Map<K,Versioned<V>> getAll(java.lang.Iterable<K> keys)
keys - The keys for which to fetch the values.
java.util.Map<K,Versioned<V>> getAll(java.lang.Iterable<K> keys,
java.util.Map<K,java.lang.Object> transforms)
getAll, except
that the transforms are applied on the value associated with each key
before returning the results
keys - the keys for which the values are fetchedtransforms - the map of transforms, describing the transform to be
applied to the value for each key
Versioned<V> get(K key,
Versioned<V> defaultValue)
key - The key for which to fetch the value.
Version put(K key,
V value)
key - The keyvalue - The value
Version put(K key,
V value,
java.lang.Object transforms)
#put(Object, Object), except
that the given transforms are applied on the value before writing it to
the store
key - the keyvalue - the valuetransforms - the transforms to be applied on the value
Version put(K key,
Versioned<V> versioned)
throws ObsoleteVersionException
key - The keyversioned - The value and its versioned
ObsoleteVersionException
boolean putIfNotObsolete(K key,
Versioned<V> versioned)
key - The keyversioned - The versioned value
boolean applyUpdate(UpdateAction<K,V> action)
action - The action to apply. This is meant as a callback for the
user to extend to provide their own logic.
boolean applyUpdate(UpdateAction<K,V> action,
int maxTries)
action - The action to apply
boolean delete(K key)
key - The key
boolean delete(K key,
Version version)
key - The key to deleteversion - The version of the key
java.util.List<voldemort.cluster.Node> getResponsibleNodes(K key)
key -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||