HBase-3758: HTable.delete triggers pre/postScannerOpen upcalls of RegionObserver

Review Request #1693 - Created April 9, 2011 and updated

Mingjie Lai
Currently RegionObserver pre/postScannerOpen() upcalls are injected at HRegion.instantiateInternalScanner(). If someone uses scanner methods at HRegion, ScannerOpen upcalls can be triggered unexpectedly. HBase-3583 pulled scannerNext and scannerClose from HRegion to HRegionServer. We also need to pull scannerOpen to HRegionObserver to prevent unexpected triggers.
Unit tests passed locally.
  1. Overall, patch looks good Mingjie.  A couple comments on the code pulled in to HRegionServer.
  2. How about moving this entire block into a new openScanner() method in HRegion?  It's kind of redundant with getScanner(), but may be a little cleaner to keep the family setting in Scan encapsulated in HRegion instead of having that pulled up here.  Thoughts?
  3. This is a change in behavior from the previous version, where the return value from RegionCoprocessorHost.postScannerOpen() is what ultimately got added to the scanner map.
    I think this line should be moved below the postScannerOpen() block.
  4. Good test.  Thanks for adding.
Review request changed

Change Summary:

Improve it by Gary's comments. 
- add a HRegion.prepareScan which adds all cf to the scan if no cf specified. 
- move addScanner() after postScannerOpen()

Please provide your feedback. 




Revision 2 (+91 -16)

Show changes

  1. +1
  1. Latest patch looks good.  Thanks Mingjie!