diff --git a/src/docbkx/book.xml b/src/docbkx/book.xml
index 7e95c357f11..a4a4bf70c5c 100644
--- a/src/docbkx/book.xml
+++ b/src/docbkx/book.xml
@@ -635,6 +635,61 @@ admin.enableTable(table);
specifies a cell in HBase.
Cell content is uninterrpreted bytes
+
+ Data Model Operations
+ The four primary data model operations are Get, Put, Scan, and Delete. Operations are applied via
+ HTable instances.
+
+
+ Get
+ Get returns
+ attributes for a specified row. Gets are executed via
+
+ HTable.get.
+
+
+
+ Put
+ Put either
+ adds new rows to a table (if the key is new) or can update existing rows (if the key already exists). Puts are executed via
+
+ HTable.put (writeBuffer) or
+ HTable.batch (non-writeBuffer).
+
+
+
+ Scans
+ Scan allow
+ iteration over multiple rows for specified attributes.
+
+ The following is an example of a
+ on an HTable table instance. Assume that a table is populated with rows with keys "row1", "row2", "row3",
+ and then another set of rows with the keys "abc1", "abc2", and "abc3". The following example shows how startRow and stopRow
+ can be applied to a Scan instance to return the rows beginning with "row".
+
+HTable htable = ... // instantiate HTable
+
+Scan scan = new Scan();
+scan.addColumn(Bytes.toBytes("cf"),Bytes.toBytes("attr"));
+scan.setStartRow( Bytes.toBytes("row"));
+scan.setStopRow( Bytes.toBytes("row" + new byte[] {0})); // note: stop key != start key
+for(Result result : htable.getScanner(scan)) {
+ // process Result instance
+}
+
+
+
+
+ Delete
+ Delete removes
+ a row from a table. Deletes are executed via
+
+ HTable.delete.
+
+
+
+
+
VersionsVersions
@@ -728,25 +783,26 @@ admin.enableTable(table);
Default Get ExampleThe following Get will only retrieve the current version of the row
-
- Get get = new Get(Bytes.toBytes("row1"));
- Result r = htable.get(get);
- byte[] b = r.getValue(Bytes.toBytes("cf"), Bytes.toBytes("attr")); // returns current version of value
+
+Get get = new Get(Bytes.toBytes("row1"));
+Result r = htable.get(get);
+byte[] b = r.getValue(Bytes.toBytes("cf"), Bytes.toBytes("attr")); // returns current version of value
+Versioned Get ExampleThe following Get will return the last 3 versions of the row.
-
- Get get = new Get(Bytes.toBytes("row1"));
- get.setMaxVersions(3); // will return last 3 versions of row
- Result r = htable.get(get);
- byte[] b = r.getValue(Bytes.toBytes("cf"), Bytes.toBytes("attr")); // returns current version of value
- List<KeyValue> kv = r.getColumn(Bytes.toBytes("cf"), Bytes.toBytes("attr")); // returns all versions of this column
-
+
+Get get = new Get(Bytes.toBytes("row1"));
+get.setMaxVersions(3); // will return last 3 versions of row
+Result r = htable.get(get);
+byte[] b = r.getValue(Bytes.toBytes("cf"), Bytes.toBytes("attr")); // returns current version of value
+List<KeyValue> kv = r.getColumn(Bytes.toBytes("cf"), Bytes.toBytes("attr")); // returns all versions of this column
+
-
+
Put
@@ -763,24 +819,25 @@ admin.enableTable(table);
Implicit Version ExampleThe following Put will be implicitly versioned by HBase with the current time.
-
- Put put = new Put(Bytes.toBytes(row));
- put.add(Bytes.toBytes("cf"), Bytes.toBytes("attr1"), Bytes.toBytes( data));
- htable.put(put);
-
+
+Put put = new Put(Bytes.toBytes(row));
+put.add(Bytes.toBytes("cf"), Bytes.toBytes("attr1"), Bytes.toBytes( data));
+htable.put(put);
+Explicit Version ExampleThe following Put has the version timestamp explicitly set.
-
- Put put = new Put( Bytes.toBytes(row ));
- long explicitTimeInMs = 555; // just an example
- put.add(Bytes.toBytes("cf"), Bytes.toBytes("attr1"), explicitTimeInMs, Bytes.toBytes(data));
- htable.put(put);
-
+
+Put put = new Put( Bytes.toBytes(row));
+long explicitTimeInMs = 555; // just an example
+put.add(Bytes.toBytes("cf"), Bytes.toBytes("attr1"), explicitTimeInMs, Bytes.toBytes(data));
+htable.put(put);
+
+