On Thu, Aug 11, 2011 at 2:20 PM, Allan Yan <[email protected]> wrote:
> Hello, > > 1. Scan s = new Scan(); > 2. s.addFamily(myFamily); > 3. s.setStartRow(startRow); > 4. Filter rowFilter = new RowFilter(CompareFilter.CompareOp.EQUAL, new > BinaryPrefixComparator(startRow)); > 5. s.setFilter(rowFilter); > > With this code, you're still only telling the scan how to filter out what to return to you, not when to stop. So your scan will be continuing from startRow to the end of the table. Try either setting stopRow in addition, or else wrap your row filter above in WhileMatchFilter -- this tells the scan to stop as soon as your filter rejects a row. http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/WhileMatchFilter.html --gh
