public void validateTableAndRegionCount(NamespaceDescriptor desc) throws IOException {
    if (getMaxRegions(desc) <= 0) {
      throw new ConstraintException(
        "The max region quota for " + desc.getName() + " is less than or equal to zero.");
    }
    if (getMaxTables(desc) <= 0) {
      throw new ConstraintException(
        "The max tables quota for " + desc.getName() + " is less than or equal to zero.");
    }
  }
check whether a namespace has already existed.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java