diff --git a/src/docbkx/book.xml b/src/docbkx/book.xml index 94c6afe8cea..83a2c118b49 100644 --- a/src/docbkx/book.xml +++ b/src/docbkx/book.xml @@ -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 } diff --git a/src/main/java/org/apache/hadoop/hbase/client/Scan.java b/src/main/java/org/apache/hadoop/hbase/client/Scan.java index 4bae646ef49..cc4c6e8d610 100644 --- a/src/main/java/org/apache/hadoop/hbase/client/Scan.java +++ b/src/main/java/org/apache/hadoop/hbase/client/Scan.java @@ -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) {