protected void undeployRegion(Connection conn, ServerName sn, RegionInfo hri)
    throws IOException, InterruptedException {
    try {
      HBaseFsckRepair.closeRegionSilentlyAndWait(conn, sn, hri);
      if (!hri.isMetaRegion()) {
        admin.offline(hri.getRegionName());
      }
    } catch (IOException ioe) {
      LOG.warn(
        "Got exception when attempting to offline region " + Bytes.toString(hri.getRegionName()),
        ioe);
    }
  }
This method is used to undeploy a region -- close it and attempt to remove its state from the
Master.
hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java