@Override
  public OfflineRegionResponse offlineRegion(RpcController controller, OfflineRegionRequest request)
    throws ServiceException {
    try {
      server.checkInitialized();

      final RegionSpecifierType type = request.getRegion().getType();
      if (type != RegionSpecifierType.REGION_NAME) {
        LOG.warn("moveRegion specifier type: expected: " + RegionSpecifierType.REGION_NAME
          + " actual: " + type);
      }

      final byte[] regionName = request.getRegion().getValue().toByteArray();
      final RegionInfo hri = server.getAssignmentManager().getRegionInfo(regionName);
      if (hri == null) {
        throw new UnknownRegionException(Bytes.toStringBinary(regionName));
      }

      if (server.cpHost != null) {
        server.cpHost.preRegionOffline(hri);
      }
      LOG.info(server.getClientIdAuditPrefix() + " offline " + hri.getRegionNameAsString());
      server.getAssignmentManager().offlineRegion(hri);
      if (server.cpHost != null) {
        server.cpHost.postRegionOffline(hri);
      }
    } catch (IOException ioe) {
      throw new ServiceException(ioe);
    }
    return OfflineRegionResponse.newBuilder().build();
  }
Offline specified region from master's in-memory state. It will not attempt to reassign the
region as in unassign. This is a special method that should be used by experts or hbck.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java