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 does the scanner api have only startRow and stopRow and not also a count? was: Improving HBase scanner
Date Tue, 04 May 2010 16:10:29 GMT
You can always add a PageFilter to your Scan instance to achieve this:
http://hadoop.apache.org/hbase/docs/r0.20.3/api/org/apache/hadoop/hbase/filter/PageFilter.html

Just be aware that you should still count on the client side if you want to
strictly limit to a given size.  Since the filter is applied independently
on each regionserver, the client can still receive back more than the page
size # of items.

--gh


On Tue, May 4, 2010 at 12:02 PM, TuX RaceR <tuxracer69@gmail.com> wrote:

> Hi Hbase users,
>
> question related to the previous one, if we want to limit the amount of
> data retrieved by a a scanner, can we tell to not scan after a number of
> rows is reached?
> If I look at another KV store (cassandra) the equivalent of the scan API
> uses there a
>
>
>     KeyRange
>
> object, see
> http://wiki.apache.org/cassandra/API
>
> *Attribute*
>
>
>
> *Type*
>
>
>
> *Default*
>
>
>
> *Required*
>
>
>
> *Description*
>
> start_key
>
>
>
> string
>
>
>
> n/a
>
>
>
> N
>
>
>
> The first key in the inclusive KeyRange.
>
> end_key
>
>
>
> string
>
>
>
> n/a
>
>
>
> N
>
>
>
> The last key in the inclusive KeyRange.
>
> start_token
>
>
>
> string
>
>
>
> n/a
>
>
>
> N
>
>
>
> The first token in the exclusive KeyRange.
>
> end_token
>
>
>
> string
>
>
>
> n/a
>
>
>
> N
>
>
>
> The last token in the exclusive KeyRange.
>
> count
>
>
>
> i32
>
>
>
> 100
>
>
>
> Y
>
>
>
> The total number of keys to permit in the KeyRange.
>
>
>     Would it be useful (performance wise) to have a 'count' parameter
>     too, or would it be useless as equivalent to end the scan loop
>     application side, when the desired number of row is reached?
>
>
>
>     Thanks
>
>
>     TuX
>
>
>

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