|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.yahoo.ycsb.DB
com.yahoo.ycsb.db.ShardClient
public class ShardClient
A client for the simple sharded MySQL called shardserver.
Field Summary | |
---|---|
boolean |
_debug
|
boolean |
_donothing
|
static int |
HttpError
|
static int |
NoMatchingRecord
|
static java.lang.String |
NoMatchingRecordString
|
static int |
Ok
|
static int |
ServerError
|
long |
TotalGetOps
|
long |
TotalGetTime
|
long |
TotalPostOps
|
long |
TotalPostTime
|
static java.lang.String |
UrlPrefix
|
Constructor Summary | |
---|---|
ShardClient()
|
Method Summary | |
---|---|
void |
cleanup()
Cleanup any state for this DB. |
int |
delete(java.lang.String table,
java.lang.String key)
Delete a record from the database. |
java.util.Vector<char[]> |
doGet(java.lang.String url)
Do a GET HTTP call. |
java.lang.String |
doPost(java.lang.String url,
java.lang.String postbody)
Do a POST HTTP call. |
void |
init()
Initialize any state for this DB. |
int |
insert(java.lang.String table,
java.lang.String key,
java.util.HashMap<java.lang.String,java.lang.String> values)
Insert a record in the database. |
static void |
main(java.lang.String[] args)
Simple test. |
int |
read(java.lang.String table,
java.lang.String key,
java.util.Set<java.lang.String> fields,
java.util.HashMap<java.lang.String,java.lang.String> result)
Read a record from the database. |
int |
scan(java.lang.String table,
java.lang.String startkey,
int recordcount,
java.util.Set<java.lang.String> fields,
java.util.Vector<java.util.HashMap<java.lang.String,java.lang.String>> result)
Perform a range scan for a set of records in the database. |
int |
update(java.lang.String table,
java.lang.String key,
java.util.HashMap<java.lang.String,java.lang.String> values)
Update a record in the database. |
Methods inherited from class com.yahoo.ycsb.DB |
---|
getProperties, setProperties |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String UrlPrefix
public static final java.lang.String NoMatchingRecordString
public static final int Ok
public static final int ServerError
public static final int HttpError
public static final int NoMatchingRecord
public boolean _debug
public boolean _donothing
public long TotalGetTime
public long TotalGetOps
public long TotalPostTime
public long TotalPostOps
Constructor Detail |
---|
public ShardClient()
Method Detail |
---|
public void init() throws DBException
init
in class DB
DBException
public void cleanup() throws DBException
cleanup
in class DB
DBException
public java.util.Vector<char[]> doGet(java.lang.String url) throws DBException
DBException
public java.lang.String doPost(java.lang.String url, java.lang.String postbody) throws DBException
DBException
public int read(java.lang.String table, java.lang.String key, java.util.Set<java.lang.String> fields, java.util.HashMap<java.lang.String,java.lang.String> result)
read
in class DB
table
- The name of the tablekey
- The record key of the record to read.fields
- The list of fields to read, or null for all of themresult
- A HashMap of field/value pairs for the result
public int scan(java.lang.String table, java.lang.String startkey, int recordcount, java.util.Set<java.lang.String> fields, java.util.Vector<java.util.HashMap<java.lang.String,java.lang.String>> result)
scan
in class DB
table
- The name of the tablestartkey
- The record key of the first record to read.recordcount
- The number of records to readfields
- The list of fields to read, or null for all of themresult
- A Vector of HashMaps, where each HashMap is a set field/value pairs for one record
public int update(java.lang.String table, java.lang.String key, java.util.HashMap<java.lang.String,java.lang.String> values)
update
in class DB
table
- The name of the tablekey
- The record key of the record to write.values
- A HashMap of field/value pairs to update in the record
public int insert(java.lang.String table, java.lang.String key, java.util.HashMap<java.lang.String,java.lang.String> values)
insert
in class DB
table
- The name of the tablekey
- The record key of the record to insert.values
- A HashMap of field/value pairs to insert in the record
public int delete(java.lang.String table, java.lang.String key)
delete
in class DB
table
- The name of the tablekey
- The record key of the record to delete.
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |