hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mesika, Asaf" <asaf.mes...@gmail.com>
Subject Getting the scan type at preCompact
Date Tue, 29 Jan 2013 13:23:45 GMT

In the RegionObserver.preCompactScannerOpen() method, one of the parameters is scanType which
enables me to know if the compaction is major or minor.
In the preCompact() method I don't have that parameter.

In a region observer I wrote, I'm basically wrapping the InternalScanner with my own Scanner.

My scanner should behave differently when its a a major or minor compaction.

Due to this restriction I'm forced to use preCompactScannerOpen() and create the StoreScanner,
copy pasting the code that creates it in Store.compactStore() (marked in green):

        if (getHRegion().getCoprocessorHost() != null) {
          scanner = getHRegion()
              .preCompactScannerOpen(this, scanners,
                  majorCompaction ? ScanType.MAJOR_COMPACT : ScanType.MINOR_COMPACT, earliestPutTs);
        if (scanner == null) {
          Scan scan = new Scan();
          /* Include deletes, unless we are doing a major compaction */
          scanner = new StoreScanner(this, getScanInfo(), scan, scanners,
            majorCompaction? ScanType.MAJOR_COMPACT : ScanType.MINOR_COMPACT,
            smallestReadPoint, earliestPutTs);
        if (getHRegion().getCoprocessorHost() != null) {
          InternalScanner cpScanner =
            getHRegion().getCoprocessorHost().preCompact(this, scanner);
          // NULL scanner returned from coprocessor hooks means skip normal processing
          if (cpScanner == null) {
            return null;
          scanner = cpScanner;

Can I file a JIRA to add the Scan Type to the preCompact method?


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