Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-6108

Use HRegion.closeHRegion instead of HRegion.close() and HRegion.getLog().close()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.95.2
    • 0.95.0
    • None
    • None
    • Reviewed

    Description

      There are a bunch of places in the code like this:
      region.close();
      region.getLog().closeAndDelete();

      Instead of the better:
      HRegion.closeHRegion(region);

      We should change these for a few reasons:
      1) If we ever need to change the implementation, it's easier to change in one place
      2) closeHRegion properly checks for nulls. There are a few places where this could make a difference, for example in TestOpenedRegionHandler.java it's possible that an exception can be thrown before "region" is assigned and thus region.close() could throw an NPE. closeHRegion avoids this issue.

      Attachments

        1. HBASE-6108.patch
          25 kB
          Gregory Chanan

        Activity

          People

            gchanan Gregory Chanan
            gchanan Gregory Chanan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: