From 771022eed95849fda841fbb69110a8a826340a4f Mon Sep 17 00:00:00 2001 From: larsh Date: Thu, 5 Jan 2012 01:17:28 +0000 Subject: [PATCH] HBASE-5118 Fix Scan documentation (Lars H) git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1227419 13f79535-47bb-0310-9956-ffa450edef68 --- src/docbkx/book.xml | 2 +- src/main/java/org/apache/hadoop/hbase/client/Scan.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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) {