public class HBaseClient
extends com.yahoo.ycsb.DB
| Modifier and Type | Field and Description |
|---|---|
int |
_batchSize |
java.lang.String |
_columnFamily |
byte[] |
_columnFamilyBytes |
boolean |
_debug |
boolean |
_writeToWal |
static int |
HttpError |
static int |
NoMatchingRecord |
static int |
Ok |
static int |
ServerError |
static java.lang.Object |
tableLock |
| Constructor and Description |
|---|
HBaseClient() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup()
Cleanup any state for this DB.
|
int |
delete(java.lang.String table,
java.lang.String key)
Delete a record from the database.
|
org.apache.hadoop.hbase.client.HTable |
getHTable(java.lang.String table) |
void |
init()
Initialize any state for this DB.
|
int |
insert(java.lang.String table,
java.lang.String key,
java.util.HashMap<java.lang.String,com.yahoo.ycsb.ByteIterator> values)
Insert a record in the database.
|
static void |
main(java.lang.String[] args) |
int |
read(java.lang.String table,
java.lang.String key,
java.util.Set<java.lang.String> fields,
java.util.HashMap<java.lang.String,com.yahoo.ycsb.ByteIterator> 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,com.yahoo.ycsb.ByteIterator>> 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,com.yahoo.ycsb.ByteIterator> values)
Update a record in the database.
|
public boolean _debug
public boolean _writeToWal
public int _batchSize
public java.lang.String _columnFamily
public byte[] _columnFamilyBytes
public static final int Ok
public static final int ServerError
public static final int HttpError
public static final int NoMatchingRecord
public static final java.lang.Object tableLock
public void init()
throws com.yahoo.ycsb.DBException
init in class com.yahoo.ycsb.DBcom.yahoo.ycsb.DBExceptionpublic void cleanup()
throws com.yahoo.ycsb.DBException
cleanup in class com.yahoo.ycsb.DBcom.yahoo.ycsb.DBExceptionpublic org.apache.hadoop.hbase.client.HTable getHTable(java.lang.String table)
public int read(java.lang.String table,
java.lang.String key,
java.util.Set<java.lang.String> fields,
java.util.HashMap<java.lang.String,com.yahoo.ycsb.ByteIterator> result)
read in class com.yahoo.ycsb.DBtable - 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 resultpublic 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,com.yahoo.ycsb.ByteIterator>> result)
scan in class com.yahoo.ycsb.DBtable - 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 recordpublic int update(java.lang.String table,
java.lang.String key,
java.util.HashMap<java.lang.String,com.yahoo.ycsb.ByteIterator> values)
update in class com.yahoo.ycsb.DBtable - The name of the tablekey - The record key of the record to writevalues - A HashMap of field/value pairs to update in the recordpublic int insert(java.lang.String table,
java.lang.String key,
java.util.HashMap<java.lang.String,com.yahoo.ycsb.ByteIterator> values)
insert in class com.yahoo.ycsb.DBtable - The name of the tablekey - The record key of the record to insert.values - A HashMap of field/value pairs to insert in the recordpublic int delete(java.lang.String table,
java.lang.String key)
delete in class com.yahoo.ycsb.DBtable - The name of the tablekey - The record key of the record to delete.public static void main(java.lang.String[] args)