HBASE-9035 Incorrect example for using a scan stopRow in HBase book
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1507863 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
52bace8612
commit
bea9384779
|
@ -269,8 +269,8 @@ HTable htable = ... // instantiate HTable
|
||||||
|
|
||||||
Scan scan = new Scan();
|
Scan scan = new Scan();
|
||||||
scan.addColumn(CF, ATTR);
|
scan.addColumn(CF, ATTR);
|
||||||
scan.setStartRow( Bytes.toBytes("row")); // start key is inclusive
|
scan.setStartRow(Bytes.toBytes("row")); // start key is inclusive
|
||||||
scan.setStopRow( Bytes.toBytes("row" + (char)0)); // stop key is exclusive
|
scan.setStopRow(Bytes.toBytes("rox")); // stop key is exclusive
|
||||||
ResultScanner rs = htable.getScanner(scan);
|
ResultScanner rs = htable.getScanner(scan);
|
||||||
try {
|
try {
|
||||||
for (Result r = rs.next(); r != null; r = rs.next()) {
|
for (Result r = rs.next(); r != null; r = rs.next()) {
|
||||||
|
@ -280,6 +280,8 @@ try {
|
||||||
}
|
}
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
<para>Note that generally the easiest way to specify a specific stop point for a scan is by using the <link xlink:href="http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/InclusiveStopFilter.html">InclusiveStopFilter</link> class.
|
||||||
|
</para>
|
||||||
</section>
|
</section>
|
||||||
<section xml:id="delete">
|
<section xml:id="delete">
|
||||||
<title>Delete</title>
|
<title>Delete</title>
|
||||||
|
|
Loading…
Reference in New Issue