private static void checkAlreadyExists(
      boolean checkCondition, String resourceType, String object) {
    if (!checkCondition) {
      throw new AlreadyExistsException(resourceType + ": " + object + " already exists.");
    }
  }
POST PREFIX/v1/catalogs/{catalog}/namespaces/{namespace}/tables/{table}/metrics
amoro-ams/src/main/java/org/apache/amoro/server/RestCatalogService.java