hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Allan Yan <hailun...@gmail.com>
Subject Re: Why RowFilter plus BinaryPrefixComparator solution is so slow
Date Fri, 12 Aug 2011 01:50:55 GMT
Hey Gary,

Thanks a lot!

With WhileMathFilter, I am able to get the same performance as stopRow
solution. And if the search is in the same HBase cluster, I am able to
get the result in a few milliseconds with 6 nodes cluster.


On Thu, Aug 11, 2011 at 2:26 PM, Gary Helmling <ghelmling@gmail.com> wrote:
> 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
View raw message