hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject svn commit: r1227419 - in /hbase/trunk/src: docbkx/book.xml main/java/org/apache/hadoop/hbase/client/Scan.java
Date Thu, 05 Jan 2012 01:17:28 GMT
Author: larsh
Date: Thu Jan  5 01:17:28 2012
New Revision: 1227419

URL: http://svn.apache.org/viewvc?rev=1227419&view=rev
Log:
HBASE-5118 Fix Scan documentation (Lars H)

Modified:
    hbase/trunk/src/docbkx/book.xml
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/Scan.java

Modified: hbase/trunk/src/docbkx/book.xml
URL: http://svn.apache.org/viewvc/hbase/trunk/src/docbkx/book.xml?rev=1227419&r1=1227418&r2=1227419&view=diff
==============================================================================
--- hbase/trunk/src/docbkx/book.xml (original)
+++ hbase/trunk/src/docbkx/book.xml Thu Jan  5 01:17:28 2012
@@ -262,7 +262,7 @@ HTable htable = ...      // instantiate 
 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
 }

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/Scan.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/Scan.java?rev=1227419&r1=1227418&r2=1227419&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/Scan.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/Scan.java Thu Jan  5 01:17:28
2012
@@ -260,7 +260,8 @@ public class Scan extends OperationWithA
 
   /**
    * 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 OperationWithA
   /**
    * 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) {



Mime
View raw message