private static void checkDatabaseExist(boolean checkCondition, String database) {
    if (!checkCondition) {
      throw new NoSuchNamespaceException("Database: " + database + " doesn't exists");
    }
  }
POST PREFIX/v1/catalogs/{catalog}/namespaces/{namespace}/tables/{table}/metrics
amoro-ams/src/main/java/org/apache/amoro/server/RestCatalogService.java