You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Keith Thomas <ke...@gmail.com> on 2010/01/06 05:18:32 UTC

Cmbining PageFilter with other Filters

As I wasn't clear whether PageFilter was intended to be used in a Scan in
conjunction with other filters I did a little experimenting. 

I took a guess - I couldn't find it documented, but maybe it is and I just
missed it - and combined my PageFilter with my other filters by creating a
FilterList with the AND operator. I had two Filter instances in my
FilterList, the PageFilter and the original Filter (which may have been a
FilterList itself). I saw inconsistent results. 

<pseudo-code>
   public Filter pageScan(Filter orig, Long count) {
      List<Filter> filters = new ArrayList<Filter>()
      FilterList filterList = new FilterList(AND, filters)

      filterList.addFilter(orig)
      filterList.addFilter(new PageFilter(count)

     return filterList
   }
</pseudo-code>

As I'm not clear whether or not I am mis-using PageFilter I have not yet put
together a detailed description of the issues I encountered. 

I am using Hadoop 0.20.0 with HBase 0.20.2. 

Any thoughts and/or suggestions?
-- 
View this message in context: http://old.nabble.com/Cmbining-PageFilter-with-other-Filters-tp27026771p27026771.html
Sent from the HBase User mailing list archive at Nabble.com.


Re: Cmbining PageFilter with other Filters

Posted by Keith Thomas <ke...@gmail.com>.
Cool. Thanks for the clarification.


stack-3 wrote:
> 
> Code looks fine Keith.
> 
> You've seen this regards page filter: "Note that this filter cannot
> guarantee that the number of results returned to a client are <= page
> size.
> This is because the filter is applied separately on different region
> servers. It does however optimize the scan of individual HRegions by
> making
> sure that the page size is never exceeded locally." from the javadoc.
> 
> St.Ack
> 
> On Tue, Jan 5, 2010 at 8:18 PM, Keith Thomas <ke...@gmail.com>
> wrote:
> 
>>
>> As I wasn't clear whether PageFilter was intended to be used in a Scan in
>> conjunction with other filters I did a little experimenting.
>>
>> I took a guess - I couldn't find it documented, but maybe it is and I
>> just
>> missed it - and combined my PageFilter with my other filters by creating
>> a
>> FilterList with the AND operator. I had two Filter instances in my
>> FilterList, the PageFilter and the original Filter (which may have been a
>> FilterList itself). I saw inconsistent results.
>>
>> <pseudo-code>
>>   public Filter pageScan(Filter orig, Long count) {
>>      List<Filter> filters = new ArrayList<Filter>()
>>      FilterList filterList = new FilterList(AND, filters)
>>
>>      filterList.addFilter(orig)
>>      filterList.addFilter(new PageFilter(count)
>>
>>     return filterList
>>   }
>> </pseudo-code>
>>
>> As I'm not clear whether or not I am mis-using PageFilter I have not yet
>> put
>> together a detailed description of the issues I encountered.
>>
>> I am using Hadoop 0.20.0 with HBase 0.20.2.
>>
>> Any thoughts and/or suggestions?
>> --
>> View this message in context:
>> http://old.nabble.com/Cmbining-PageFilter-with-other-Filters-tp27026771p27026771.html
>> Sent from the HBase User mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://old.nabble.com/Combining-PageFilter-with-other-Filters-tp27026771p27055519.html
Sent from the HBase User mailing list archive at Nabble.com.


Re: Cmbining PageFilter with other Filters

Posted by stack <st...@duboce.net>.
Code looks fine Keith.

You've seen this regards page filter: "Note that this filter cannot
guarantee that the number of results returned to a client are <= page size.
This is because the filter is applied separately on different region
servers. It does however optimize the scan of individual HRegions by making
sure that the page size is never exceeded locally." from the javadoc.

St.Ack

On Tue, Jan 5, 2010 at 8:18 PM, Keith Thomas <ke...@gmail.com> wrote:

>
> As I wasn't clear whether PageFilter was intended to be used in a Scan in
> conjunction with other filters I did a little experimenting.
>
> I took a guess - I couldn't find it documented, but maybe it is and I just
> missed it - and combined my PageFilter with my other filters by creating a
> FilterList with the AND operator. I had two Filter instances in my
> FilterList, the PageFilter and the original Filter (which may have been a
> FilterList itself). I saw inconsistent results.
>
> <pseudo-code>
>   public Filter pageScan(Filter orig, Long count) {
>      List<Filter> filters = new ArrayList<Filter>()
>      FilterList filterList = new FilterList(AND, filters)
>
>      filterList.addFilter(orig)
>      filterList.addFilter(new PageFilter(count)
>
>     return filterList
>   }
> </pseudo-code>
>
> As I'm not clear whether or not I am mis-using PageFilter I have not yet
> put
> together a detailed description of the issues I encountered.
>
> I am using Hadoop 0.20.0 with HBase 0.20.2.
>
> Any thoughts and/or suggestions?
> --
> View this message in context:
> http://old.nabble.com/Cmbining-PageFilter-with-other-Filters-tp27026771p27026771.html
> Sent from the HBase User mailing list archive at Nabble.com.
>
>