<IMGSRC="../../../resources/inherit.gif"ALT="extended by "><B>com.yahoo.ycsb.DB</B>
</PRE>
<DL>
<DT><B>Direct Known Subclasses:</B><DD><AHREF="../../../com/yahoo/ycsb/BasicDB.html"title="class in com.yahoo.ycsb">BasicDB</A>, <AHREF="../../../com/yahoo/ycsb/db/CassandraClient5.html"title="class in com.yahoo.ycsb.db">CassandraClient5</A>, <AHREF="../../../com/yahoo/ycsb/db/CassandraClient6.html"title="class in com.yahoo.ycsb.db">CassandraClient6</A>, <AHREF="../../../com/yahoo/ycsb/db/CassandraClient7.html"title="class in com.yahoo.ycsb.db">CassandraClient7</A>, <AHREF="../../../com/yahoo/ycsb/DBWrapper.html"title="class in com.yahoo.ycsb">DBWrapper</A>, <AHREF="../../../com/yahoo/ycsb/db/HBaseClient.html"title="class in com.yahoo.ycsb.db">HBaseClient</A>, <AHREF="../../../com/yahoo/ycsb/db/MongoDbClient.html"title="class in com.yahoo.ycsb.db">MongoDbClient</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public abstract class <B>DB</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
A layer for accessing a database to be benchmarked. Each thread in the client
will be given its own instance of whatever DB class is to be used in the test.
This class should be constructed using a no-argument constructor, so we can
load it dynamically. Any argument-based initialization should be
done by init().
Note that YCSB does not make any use of the return codes returned by this class.
Instead, it keeps a count of the return values and presents them to the user.
The semantics of methods such as insert, update and delete vary from database
to database. In particular, operations may or may not be durable once these
methods commit, and some systems may return 'success' regardless of whether
or not a tuple with a matching key existed before the call. Rather than dictate
the exact semantics of these methods, we recommend you either implement them
to match the database's default semantics, or the semantics of your
target application. For the sake of comparison between experiments we also
recommend you explain the semantics you chose when presenting performance results.
<DD>Read a record from the database. Each field/value pair from the result will be stored in a HashMap.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to read.<DD><CODE>fields</CODE> - The list of fields to read, or null for all of them<DD><CODE>result</CODE> - A HashMap of field/value pairs for the result
<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error or "not found".</DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>startkey</CODE> - The record key of the first record to read.<DD><CODE>recordcount</CODE> - The number of records to read<DD><CODE>fields</CODE> - The list of fields to read, or null for all of them<DD><CODE>result</CODE> - A Vector of HashMaps, where each HashMap is a set field/value pairs for one record
<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error. See this class's description for a discussion of error codes.</DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to write.<DD><CODE>values</CODE> - A HashMap of field/value pairs to update in the record
<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error. See this class's description for a discussion of error codes.</DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>table</CODE> - The name of the table<DD><CODE>key</CODE> - The record key of the record to insert.<DD><CODE>values</CODE> - A HashMap of field/value pairs to insert in the record
<DT><B>Returns:</B><DD>Zero on success, a non-zero error code on error. See this class's description for a discussion of error codes.</DL>