@Override
  public void postOpenDeployTasks(final PostOpenDeployContext context) throws IOException {
    HRegion r = context.getRegion();
    long openProcId = context.getOpenProcId();
    long masterSystemTime = context.getMasterSystemTime();
    long initiatingMasterActiveTime = context.getInitiatingMasterActiveTime();
    rpcServices.checkOpen();
    LOG.info("Post open deploy tasks for {}, pid={}, masterSystemTime={}",
      r.getRegionInfo().getRegionNameAsString(), openProcId, masterSystemTime);
    // Do checks to see if we need to compact (references or too many files)
    // Skip compaction check if region is read only
    if (!r.isReadOnly()) {
      for (HStore s : r.stores.values()) {
        if (s.hasReferences() || s.needsCompaction()) {
          this.compactSplitThread.requestSystemCompaction(r, s, "Opening Region");
        }
      }
    }
    long openSeqNum = r.getOpenSeqNum();
    if (openSeqNum == HConstants.NO_SEQNUM) {
      // If we opened a region, we should have read some sequence number from it.
      LOG.error(
        "No sequence number found when opening " + r.getRegionInfo().getRegionNameAsString());
      openSeqNum = 0;
    }

    // Notify master
    if (
      !reportRegionStateTransition(new RegionStateTransitionContext(TransitionCode.OPENED,
        openSeqNum, openProcId, masterSystemTime, r.getRegionInfo(), initiatingMasterActiveTime))
    ) {
      throw new IOException(
        "Failed to report opened region to master: " + r.getRegionInfo().getRegionNameAsString());
    }

    triggerFlushInPrimaryRegion(r);

    LOG.debug("Finished post open deploy task for " + r.getRegionInfo().getRegionNameAsString());
  }
Stops the regionserver.
@param msg   Status message
@param force True if this is a regionserver abort
@param user  The user executing the stop request, or null if no user is associated
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java