Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase, mail # user - Need to fast-forward a scanner inside a coprocessor


Copy link to this message
-
Re: Need to fast-forward a scanner inside a coprocessor
Tom Brown 2012-08-04, 00:47
So I understand I'll need to upgrade to 0.94 (which won't be a problem
because the releases are binary-compatible).  I see that the
RegionScanner interface contains the new method "reseek(byte[] row)".

I have a reference to a RegionScanner in my coprocessor because I'm
using: getEnvironment().getRegion().getScanner(scan).

What I don't understand is your conditional statement "it depends
specifically on where you hook this up".  I'm not doing anything with
"postScannerOpen".  Since I have an instance of a RegionScanner,
should I expect "reseek" to work, as long as I'm seeking forward? Is
the way I'm using it up compatible with how it should work?

--Tom

On Fri, Aug 3, 2012 at 3:05 PM, lars hofhansl <[EMAIL PROTECTED]> wrote:
> We recently added a new API for that:
> RegionScanner.reseek(...). See HBASE-5520. 0.94+ only, unfortunately.
>
> So it depends specifically on where you hook this up. If you do it at RegionObserver.postScannerOpen you can reseek forward at any time.
>
>
> -- Lars
>
>
>
> ----- Original Message -----
> From: Tom Brown <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Cc:
> Sent: Friday, August 3, 2012 1:27 PM
> Subject: Need to fast-forward a scanner inside a coprocessor
>
> I have a custom coprocessor that aggregates a selection of records
> from the table based various criteria. For efficiency, I would like to
> make it skip a bunch of records. For example, if I don't need any
> "AAAA" records and I encounter "AAAA0000", I would like to tell it to
> skip everything until "AAAB.."
>
> I don't see any methods of the InternalScanner class that would give
> me that ability. Do I need to close the current scanner and open a new
> one? Does that add significant overhead (which would reduce any gains
> achieved by skipping small numbers of records)?
>
> I am using HBase 0.92. Upgrading to 0.94 is possible if it gives this
> functionality.
>
> --Tom
>