HBASE-5118 Fix Scan documentation (Lars H)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1227419 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
larsh 2012-01-05 01:17:28 +00:00
parent 49f35a7756
commit 771022eed9
2 changed files with 4 additions and 2 deletions

View File

@ -262,7 +262,7 @@ HTable htable = ... // instantiate HTable
Scan scan = new Scan();
scan.addColumn(Bytes.toBytes("cf"),Bytes.toBytes("attr"));
scan.setStartRow( Bytes.toBytes("row")); // start key is inclusive
scan.setStopRow( Bytes.toBytes("row" + new byte[] {0})); // stop key is exclusive
scan.setStopRow( Bytes.toBytes("row" + (char)0)); // stop key is exclusive
for(Result result : htable.getScanner(scan)) {
// process Result instance
}

View File

@ -260,7 +260,8 @@ public class Scan extends OperationWithAttributes implements Writable {
/**
* Set the start row of the scan.
* @param startRow row to start scan on, inclusive
* @param startRow row to start scan on (inclusive)
* Note: In order to make startRow exclusive add a trailing 0 byte
* @return this
*/
public Scan setStartRow(byte [] startRow) {
@ -271,6 +272,7 @@ public class Scan extends OperationWithAttributes implements Writable {
/**
* Set the stop row.
* @param stopRow row to end at (exclusive)
* Note: In order to make stopRow inclusive add a trailing 0 byte
* @return this
*/
public Scan setStopRow(byte [] stopRow) {