@Override
  public void process() throws IOException {
    boolean openSuccessful = false;
    final String regionName = regionInfo.getRegionNameAsString();
    HRegion region = null;

    try {
      if (this.server.isStopped() || this.rsServices.isStopping()) {
        return;
      }
      final String encodedName = regionInfo.getEncodedName();

      // 2 different difficult situations can occur
      // 1) The opening was cancelled. This is an expected situation
      // 2) The region is now marked as online while we're suppose to open. This would be a bug.

      // Check that this region is not already online
      if (this.rsServices.getRegion(encodedName) != null) {
        LOG.error(
          "Region " + encodedName + " was already online when we started processing the opening. "
            + "Marking this new attempt as failed");
        return;
      }

      // Check that we're still supposed to open the region.
      // If fails, just return. Someone stole the region from under us.
      if (!isRegionStillOpening()) {
        LOG.error("Region " + encodedName + " opening cancelled");
        return;
      }

      // Open region. After a successful open, failures in subsequent
      // processing needs to do a close as part of cleanup.
      region = openRegion();
      if (region == null) {
        return;
      }

      if (
        !updateMeta(region, masterSystemTime) || this.server.isStopped()
          || this.rsServices.isStopping()
      ) {
        return;
      }

      if (!isRegionStillOpening()) {
        return;
      }

      // Successful region open, and add it to MutableOnlineRegions
      this.rsServices.addRegion(region);
      openSuccessful = true;

      // Done! Successful region open
      LOG.debug("Opened " + regionName + " on " + this.server.getServerName());
    } finally {
      // Do all clean up here
      if (!openSuccessful) {
        doCleanUpOnFailedOpen(region);
      }
      final Boolean current = this.rsServices.getRegionsInTransitionInRS()
        .remove(this.regionInfo.getEncodedNameAsBytes());

      // Let's check if we have met a race condition on open cancellation....
      // A better solution would be to not have any race condition.
      // this.rsServices.getRegionsInTransitionInRS().remove(
      // this.regionInfo.getEncodedNameAsBytes(), Boolean.TRUE);
      // would help.
      if (openSuccessful) {
        if (current == null) { // Should NEVER happen, but let's be paranoid.
          LOG.error("Bad state: we've just opened a region that was NOT in transition. Region="
            + regionName);
        } else if (Boolean.FALSE.equals(current)) { // Can happen, if we're
                                                    // really unlucky.
          LOG.error("Race condition: we've finished to open a region, while a close was requested "
            + " on region=" + regionName + ". It can be a critical error, as a region that"
            + " should be closed is now opened. Closing it now");
          cleanupFailedOpen(region);
        }
      }
    }
  }
Handles opening of a region on a region server.
<p>
This is executed after receiving an OPEN RPC from the master or client.
@deprecated Keep it here only for compatible
@see AssignRegionHandler
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java