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 <[email protected]> wrote:
> 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
>

Reply via email to