|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.yahoo.ycsb.DataStore
com.yahoo.ycsb.memcached.Memcached
com.yahoo.ycsb.memcached.MemcachedWrapper
public class MemcachedWrapper
Wrapper around a "real" DB that measures latencies and counts return codes.
Constructor Summary | |
---|---|
MemcachedWrapper(Memcached memcached)
|
Method Summary | |
---|---|
int |
add(java.lang.String key,
java.lang.Object value)
Adds a keys value in the database if the key doesn't already exist |
int |
append(java.lang.String key,
long cas,
java.lang.Object value)
Appends a value to a keys current value |
int |
cas(java.lang.String key,
long cas,
java.lang.Object value)
Stores a new value if the operation has the correct cas value |
void |
cleanup()
Cleanup any state for this Memcached. |
int |
decr(java.lang.String key,
java.lang.Object value)
Decrement a keys value in the database |
int |
delete(java.lang.String key)
Delete a key from the database |
int |
get(java.lang.String key,
java.lang.Object value)
Get a key's value from the database. |
java.util.Properties |
getProperties()
Get the set of properties for this Memcached. |
long |
gets(java.lang.String key)
Gets a unique cas value for a key. |
int |
incr(java.lang.String key,
java.lang.Object value)
Increment a keys value in the database |
void |
init()
Initialize any state for this Memcached. |
int |
prepend(java.lang.String key,
long cas,
java.lang.Object value)
Prepends a value to a keys current value |
int |
replace(java.lang.String key,
java.lang.Object value)
Replaces the value of a key already in the database. |
int |
set(java.lang.String key,
java.lang.Object value)
Insert a record in the database. |
void |
setProperties(java.util.Properties p)
Set the properties for this Memcached. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MemcachedWrapper(Memcached memcached)
Method Detail |
---|
public void setProperties(java.util.Properties p)
setProperties
in class DataStore
public java.util.Properties getProperties()
getProperties
in class DataStore
public void init() throws DataStoreException
init
in class DataStore
DataStoreException
public void cleanup() throws DataStoreException
cleanup
in class DataStore
DataStoreException
public int add(java.lang.String key, java.lang.Object value)
add
in class Memcached
key
- The key to add to the databasevalue
- The Object that will be the value of the key
public int append(java.lang.String key, long cas, java.lang.Object value)
append
in class Memcached
key
- The key who's value will be appended.The
- unique cas value to do the append withvalue
- The Object to append to the end of the keys current value
public int cas(java.lang.String key, long cas, java.lang.Object value)
cas
in class Memcached
key
- The key whose value will be replace in the databasecas
- The unique cas value to do the operation withvalue
- The Object to replace the keys old value with.
public int decr(java.lang.String key, java.lang.Object value)
decr
in class Memcached
key
- The key whose value will be decrementedvalue
- The Object that the key should contain after decrementing
public int delete(java.lang.String key)
delete
in class Memcached
key
- The key to delete
public int incr(java.lang.String key, java.lang.Object value)
incr
in class Memcached
key
- The key whose value will be incrementedvalue
- The Object that the key should contain after incrementing
public int get(java.lang.String key, java.lang.Object value)
get
in class Memcached
key
- The key to get a value for.value
- The Object that the key should contain
public long gets(java.lang.String key)
gets
in class Memcached
key
- The key to get a cas value for
public int prepend(java.lang.String key, long cas, java.lang.Object value)
prepend
in class Memcached
key
- The key who's value will be prepended.The
- unique cas value to do the prepend withvalue
- The Object to prepend to the front of the keys current value
public int replace(java.lang.String key, java.lang.Object value)
replace
in class Memcached
key
- The key who's value will be replaced.value
- The Object that will replace the old key value.
public int set(java.lang.String key, java.lang.Object value)
set
in class Memcached
key
- The record key of the record to set.value
- The Object to use as the keys value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |