hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Brown <tombrow...@gmail.com>
Subject Re: Need to fast-forward a scanner inside a coprocessor
Date Sat, 04 Aug 2012 00:47:34 GMT
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?


On Fri, Aug 3, 2012 at 3:05 PM, lars hofhansl <lhofhansl@yahoo.com> 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 <tombrown52@gmail.com>
> To: user@hbase.apache.org
> 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

View raw message