|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvoldemort.client.DefaultStoreClient<K,V>
K - The key typeV - The value typepublic class DefaultStoreClient<K,V>
The default StoreClient implementation
you get back from a StoreClientFactory
| Constructor Summary | |
|---|---|
DefaultStoreClient(java.lang.String storeName,
InconsistencyResolver<Versioned<V>> resolver,
StoreClientFactory storeFactory,
int maxMetadataRefreshAttempts)
|
|
| 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. |
void |
bootStrap()
|
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,
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.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. |
void |
put(K key,
V value)
Associated the given value to the key, clobbering any existing values stored for the key. |
void |
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. |
boolean |
putIfNotObsolete(K key,
Versioned<V> versioned)
Put the versioned value to the key, ignoring any ObsoleteVersionException that may be thrown |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultStoreClient(java.lang.String storeName,
InconsistencyResolver<Versioned<V>> resolver,
StoreClientFactory storeFactory,
int maxMetadataRefreshAttempts)
| Method Detail |
|---|
public void bootStrap()
public boolean delete(K key)
StoreClient
delete in interface StoreClient<K,V>key - The key
public boolean delete(K key,
Version version)
StoreClient
delete in interface StoreClient<K,V>key - The key to deleteversion - The version of the key
public V getValue(K key,
V defaultValue)
StoreClient
getValue in interface StoreClient<K,V>key - The key for which to fetch the associated valuedefaultValue - A value to return if there is no value associated
with this key
public V getValue(K key)
StoreClient
getValue in interface StoreClient<K,V>key - The key
public Versioned<V> get(K key,
Versioned<V> defaultValue)
StoreClient
get in interface StoreClient<K,V>key - The key for which to fetch the value.
public Versioned<V> get(K key)
StoreClient
get in interface StoreClient<K,V>key - The key for which to fetch the value.
public java.util.Map<K,Versioned<V>> getAll(java.lang.Iterable<K> keys)
StoreClient
getAll in interface StoreClient<K,V>keys - The keys for which to fetch the values.
public void put(K key,
V value)
StoreClient
put in interface StoreClient<K,V>key - The keyvalue - The value
public boolean putIfNotObsolete(K key,
Versioned<V> versioned)
StoreClient
putIfNotObsolete in interface StoreClient<K,V>key - The keyversioned - The versioned value
public void put(K key,
Versioned<V> versioned)
throws ObsoleteVersionException
StoreClient
put in interface StoreClient<K,V>key - The keyversioned - The value and its versioned
ObsoleteVersionExceptionpublic boolean applyUpdate(UpdateAction<K,V> action)
StoreClient
applyUpdate in interface StoreClient<K,V>action - The action to apply. This is meant as a callback for the
user to extend to provide their own logic.
public boolean applyUpdate(UpdateAction<K,V> action,
int maxTries)
StoreClient
applyUpdate in interface StoreClient<K,V>action - The action to apply
public java.util.List<voldemort.cluster.Node> getResponsibleNodes(K key)
StoreClient
getResponsibleNodes in interface StoreClient<K,V>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||