Class HBaseClient

java.lang.Object
com.yahoo.ycsb.DB
com.yahoo.ycsb.db.HBaseClient

public class HBaseClient extends com.yahoo.ycsb.DB
HBase client for YCSB framework
  • Field Details

    • _debug

      public boolean _debug
    • _writeToWal

      public boolean _writeToWal
    • _batchSize

      public int _batchSize
    • _columnFamily

      public String _columnFamily
    • _columnFamilyBytes

      public byte[] _columnFamilyBytes
    • Ok

      public static final int Ok
      See Also:
    • ServerError

      public static final int ServerError
      See Also:
    • HttpError

      public static final int HttpError
      See Also:
    • NoMatchingRecord

      public static final int NoMatchingRecord
      See Also:
    • tableLock

      public static final Object tableLock
  • Constructor Details

    • HBaseClient

      public HBaseClient()
  • Method Details

    • init

      public void init() throws com.yahoo.ycsb.DBException
      Initialize any state for this DB. Called once per DB instance; there is one DB instance per client thread.
      Overrides:
      init in class com.yahoo.ycsb.DB
      Throws:
      com.yahoo.ycsb.DBException
    • cleanup

      public void cleanup() throws com.yahoo.ycsb.DBException
      Cleanup any state for this DB. Called once per DB instance; there is one DB instance per client thread.
      Overrides:
      cleanup in class com.yahoo.ycsb.DB
      Throws:
      com.yahoo.ycsb.DBException
    • getHTable

      public org.apache.hadoop.hbase.client.HTable getHTable(String table)
    • read

      public int read(String table, String key, Set<String> fields, HashMap<String,com.yahoo.ycsb.ByteIterator> result)
      Read a record from the database. Each field/value pair from the result will be stored in a HashMap.
      Specified by:
      read in class com.yahoo.ycsb.DB
      Parameters:
      table - The name of the table
      key - The record key of the record to read.
      fields - The list of fields to read, or null for all of them
      result - A HashMap of field/value pairs for the result
      Returns:
      Zero on success, a non-zero error code on error
    • scan

      public int scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String,com.yahoo.ycsb.ByteIterator>> result)
      Perform a range scan for a set of records in the database. Each field/value pair from the result will be stored in a HashMap.
      Specified by:
      scan in class com.yahoo.ycsb.DB
      Parameters:
      table - The name of the table
      startkey - The record key of the first record to read.
      recordcount - The number of records to read
      fields - The list of fields to read, or null for all of them
      result - A Vector of HashMaps, where each HashMap is a set field/value pairs for one record
      Returns:
      Zero on success, a non-zero error code on error
    • update

      public int update(String table, String key, HashMap<String,com.yahoo.ycsb.ByteIterator> values)
      Update a record in the database. Any field/value pairs in the specified values HashMap will be written into the record with the specified record key, overwriting any existing values with the same field name.
      Specified by:
      update in class com.yahoo.ycsb.DB
      Parameters:
      table - The name of the table
      key - The record key of the record to write
      values - A HashMap of field/value pairs to update in the record
      Returns:
      Zero on success, a non-zero error code on error
    • insert

      public int insert(String table, String key, HashMap<String,com.yahoo.ycsb.ByteIterator> values)
      Insert a record in the database. Any field/value pairs in the specified values HashMap will be written into the record with the specified record key.
      Specified by:
      insert in class com.yahoo.ycsb.DB
      Parameters:
      table - The name of the table
      key - The record key of the record to insert.
      values - A HashMap of field/value pairs to insert in the record
      Returns:
      Zero on success, a non-zero error code on error
    • delete

      public int delete(String table, String key)
      Delete a record from the database.
      Specified by:
      delete in class com.yahoo.ycsb.DB
      Parameters:
      table - The name of the table
      key - The record key of the record to delete.
      Returns:
      Zero on success, a non-zero error code on error
    • main

      public static void main(String[] args)