public void deleteNamespace(String namespaceName) throws IOException {
    checkMigrationDone();
    Delete d = new Delete(Bytes.toBytes(namespaceName));
    try (Table table = masterServices.getConnection().getTable(TableName.META_TABLE_NAME)) {
      table.delete(d);
    }
    cache.remove(namespaceName);
  }
check whether a namespace has already existed.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java