hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Helmling <ghelml...@gmail.com>
Subject Re: Why RowFilter plus BinaryPrefixComparator solution is so slow
Date Thu, 11 Aug 2011 21:26:16 GMT
On Thu, Aug 11, 2011 at 2:20 PM, Allan Yan <hailunyan@gmail.com> 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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message