com.yahoo.ycsb.db
Class SpymemcachedClient

java.lang.Object
  extended by com.yahoo.ycsb.DataStore
      extended by com.yahoo.ycsb.memcached.Memcached
          extended by com.yahoo.ycsb.db.SpymemcachedClient

public class SpymemcachedClient
extends Memcached


Field Summary
static MemcachedClient client
           
static java.lang.String MEMBASE_PORT
           
static java.lang.String MEMBASE_PORT_DEFAULT
           
static java.lang.String SIMULATE_DELAY
           
static java.lang.String SIMULATE_DELAY_DEFAULT
           
static java.lang.String VERBOSE
           
static java.lang.String VERBOSE_DEFAULT
           
 
Constructor Summary
SpymemcachedClient()
           
 
Method Summary
 int add(java.lang.String key, java.lang.Object value)
          Add a value in the database.
 int append(java.lang.String key, long cas, java.lang.Object value)
          Append a value in the database.
 int cas(java.lang.String key, long cas, java.lang.Object value)
          Does a Create and store operation.
 int decr(java.lang.String key, java.lang.Object value)
          Decrement a value in the database.
 int delete(java.lang.String key)
          Delete a value from the database.
 int get(java.lang.String key, java.lang.Object value)
          Get a value from the database.
 long gets(java.lang.String key)
          Get a CAS identifier for a value in the database
 int incr(java.lang.String key, java.lang.Object value)
          Increment a value in the database.
 void init()
          Initialize any state for this DB.
 int prepend(java.lang.String key, long cas, java.lang.Object value)
          Prepends a value to a specific keys current value
 int replace(java.lang.String key, java.lang.Object value)
          Replaces the current value of a key if the key already exists
 int set(java.lang.String key, java.lang.Object value)
          Set a record in the database.
 
Methods inherited from class com.yahoo.ycsb.DataStore
cleanup, getProperties, setProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

client

public static MemcachedClient client

VERBOSE

public static final java.lang.String VERBOSE
See Also:
Constant Field Values

VERBOSE_DEFAULT

public static final java.lang.String VERBOSE_DEFAULT
See Also:
Constant Field Values

SIMULATE_DELAY

public static final java.lang.String SIMULATE_DELAY
See Also:
Constant Field Values

SIMULATE_DELAY_DEFAULT

public static final java.lang.String SIMULATE_DELAY_DEFAULT
See Also:
Constant Field Values

MEMBASE_PORT

public static final java.lang.String MEMBASE_PORT
See Also:
Constant Field Values

MEMBASE_PORT_DEFAULT

public static final java.lang.String MEMBASE_PORT_DEFAULT
See Also:
Constant Field Values
Constructor Detail

SpymemcachedClient

public SpymemcachedClient()
Method Detail

init

public void init()
Initialize any state for this DB. Called once per DB instance; there is one DB instance per client thread.

Overrides:
init in class DataStore

add

public int add(java.lang.String key,
               java.lang.Object value)
Description copied from class: Memcached
Add a value in the database. Any key/value pair in the specified value Object will be added as a value to a specific key.

Specified by:
add in class Memcached
Parameters:
key - The key of the value to add.
value - An Object to use as the key's value
Returns:
Zero on success, a non-zero error code on error. See this class's description for a discussion of error codes.

get

public int get(java.lang.String key,
               java.lang.Object value)
Description copied from class: Memcached
Get a value from the database. Any key/value pair in the specified value Object will be check against the value returned from the database.

Specified by:
get in class Memcached
Parameters:
key - The key of the value to get.
value - The Object that the key should contain
Returns:
Zero on success, a non-zero error code on error. See this class's description for a discussion of error codes.

set

public int set(java.lang.String key,
               java.lang.Object value)
Description copied from class: Memcached
Set a record in the database. Any key/value pair in the specified values Object will be written into the key with the specified value.

Specified by:
set in class Memcached
Parameters:
key - The key of the value to insert.
value - An Object to use as the key's value
Returns:
Zero on success, a non-zero error code on error. See this class's description for a discussion of error codes.

append

public int append(java.lang.String key,
                  long cas,
                  java.lang.Object value)
Description copied from class: Memcached
Append a value in the database. Any key/value pair in the specified value Object will be appended onto the value with the specified key.

Specified by:
append in class Memcached
Parameters:
key - The key of the value to be appended to.
cas - The cas value needed to do the append
value - An Object to use as the key's value
Returns:
Zero on success, a non-zero error code on error. See this class's description for a discussion of error codes.

cas

public int cas(java.lang.String key,
               long cas,
               java.lang.Object value)
Description copied from class: Memcached
Does a Create and store operation.

Specified by:
cas in class Memcached
Parameters:
key - The key of the value to do the cas.
cas - The cas value needed to do the append
value - An Object to use as the key's value
Returns:
Zero on success, a non-zero error code on error. See this class's description for a discussion of error codes.

decr

public int decr(java.lang.String key,
                java.lang.Object value)
Description copied from class: Memcached
Decrement a value in the database.

Specified by:
decr in class Memcached
Parameters:
key - The key of the value to be decremented.
value - An Object to use as the key's value
Returns:
Zero on success, a non-zero error code on error. See this class's description for a discussion of error codes.

delete

public int delete(java.lang.String key)
Description copied from class: Memcached
Delete a value from the database.

Specified by:
delete in class Memcached
Parameters:
key - The key of the value to be deleted.
Returns:
Zero on success, a non-zero error code on error. See this class's description for a discussion of error codes.

incr

public int incr(java.lang.String key,
                java.lang.Object value)
Description copied from class: Memcached
Increment a value in the database.

Specified by:
incr in class Memcached
Parameters:
key - The key of the value to be incremented.
value - An Object to use as the key's value
Returns:
Zero on success, a non-zero error code on error. See this class's description for a discussion of error codes.

gets

public long gets(java.lang.String key)
Description copied from class: Memcached
Get a CAS identifier for a value in the database

Specified by:
gets in class Memcached
Parameters:
key - The key of the value to get a CAS identifier for
Returns:
The CAS identifier on success, a non-zero error code on error. See this class's description for a discussion of error codes.

prepend

public int prepend(java.lang.String key,
                   long cas,
                   java.lang.Object value)
Description copied from class: Memcached
Prepends a value to a specific keys current value

Specified by:
prepend in class Memcached
Parameters:
key - The key of the value to prepend.
value - The Object to prepend to the current key
Returns:
Zero on success, a non-zero error code on error. See this class's description for a discussion of error codes.

replace

public int replace(java.lang.String key,
                   java.lang.Object value)
Description copied from class: Memcached
Replaces the current value of a key if the key already exists

Specified by:
replace in class Memcached
Parameters:
key - The key of the value to replace.
value - The Object to replace the old value with
Returns:
Zero on success, a non-zero error code on error. See this class's description for a discussion of error codes.