Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase >> mail # user >> Why RowFilter plus BinaryPrefixComparator solution is so slow


Copy link to this message
-
Re: Why RowFilter plus BinaryPrefixComparator solution is so slow
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