public void checkQuotaToCreateTable(TableName tName, int regions) throws IOException {
    if (stateManager.isInitialized()) {
      // We do this check to fail fast.
      if (masterServices.getTableDescriptors().exists(tName)) {
        throw new TableExistsException(tName);
      }
      stateManager.checkAndUpdateNamespaceTableCount(tName, regions);
    } else {
      checkTableTypeAndThrowException(tName);
    }
  }
Check quota to create table. We add the table information to namespace state cache, assuming
the operation will pass. If the operation fails, then the next time namespace state chore runs
namespace state cache will be corrected.
@param tName   - The table name to check quota.
@param regions - Number of regions that will be added.
@throws IOException Signals that an I/O exception has occurred.
hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceAuditor.java