You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Ferdy Galema <fe...@kalooga.com> on 2012/08/27 16:33:26 UTC
fast way to do random getRowOrAfter reads
I want to do a lot of random reads, but I need to get the first row after
the requested key. I know I can make a scanner every time (with a specified
startrow) and close it after a single result is fetched, but this seems
like a lot overhead.
Something like HTable's getRowOrBefore method, but then getRowOrAfter.
(Note that getRowOrBefore is deprecated).
Any advice?
Re: fast way to do random getRowOrAfter reads
Posted by jmozah <jm...@gmail.com>.
Get is internally treated very similar to SCANs in the RS. So this is expected.
./Zahoor
HBase Musings
On 29-Aug-2012, at 9:15 PM, Ferdy Galema <fe...@kalooga.com> wrote:
> Ran some tests and it seems that single-use Scanner requests are not that
> bad after all. I guess the important part is to set row caching to 1 and
> correctly close every scanner afterwards.
>
> On Mon, Aug 27, 2012 at 4:33 PM, Ferdy Galema <fe...@kalooga.com>wrote:
>
>> I want to do a lot of random reads, but I need to get the first row after
>> the requested key. I know I can make a scanner every time (with a specified
>> startrow) and close it after a single result is fetched, but this seems
>> like a lot overhead.
>>
>> Something like HTable's getRowOrBefore method, but then getRowOrAfter.
>> (Note that getRowOrBefore is deprecated).
>>
>> Any advice?
>>
Re: fast way to do random getRowOrAfter reads
Posted by Ferdy Galema <fe...@kalooga.com>.
Ran some tests and it seems that single-use Scanner requests are not that
bad after all. I guess the important part is to set row caching to 1 and
correctly close every scanner afterwards.
On Mon, Aug 27, 2012 at 4:33 PM, Ferdy Galema <fe...@kalooga.com>wrote:
> I want to do a lot of random reads, but I need to get the first row after
> the requested key. I know I can make a scanner every time (with a specified
> startrow) and close it after a single result is fetched, but this seems
> like a lot overhead.
>
> Something like HTable's getRowOrBefore method, but then getRowOrAfter.
> (Note that getRowOrBefore is deprecated).
>
> Any advice?
>