private boolean prepareModify(final MasterProcedureEnv env) throws IOException {
    if (!getTableNamespaceManager(env).doesNamespaceExist(newNsDescriptor.getName())) {
      setFailure("master-modify-namespace",
        new NamespaceNotFoundException(newNsDescriptor.getName()));
      return false;
    }
    getTableNamespaceManager(env).validateTableAndRegionCount(newNsDescriptor);

    // This is used for rollback
    oldNsDescriptor = getTableNamespaceManager(env).get(newNsDescriptor.getName());
    if (
      !Objects.equals(oldNsDescriptor.getConfigurationValue(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP),
        newNsDescriptor.getConfigurationValue(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP))
    ) {
      checkNamespaceRSGroup(env, newNsDescriptor);
    }
    return true;
  }
Action before any real action of adding namespace.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ModifyNamespaceProcedure.java