dimas-b commented on code in PR #2887:
URL: https://github.com/apache/polaris/pull/2887#discussion_r2478684323


##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogAdapter.java:
##########
@@ -755,7 +760,16 @@ public Response reportMetrics(
       ReportMetricsRequest reportMetricsRequest,
       RealmContext realmContext,
       SecurityContext securityContext) {
-    return Response.status(Response.Status.NO_CONTENT).build();
+
+    Namespace ns = decodeNamespace(namespace);
+    TableIdentifier tableIdentifier = TableIdentifier.of(ns, 
RESTUtil.decodeString(table));
+    return withCatalog(
+        securityContext,
+        prefix,
+        catalog -> {
+          catalog.reportMetric(prefix, tableIdentifier, reportMetricsRequest);

Review Comment:
   Yes, that pattern exists for "catalog" operations... however, in this case 
the "catalog" does not really handle anything in the metrics reports. I do not 
really see a need to for an extra indirection layer (i.e. 
`catalog.reportMetric(...)`). It seems quite possible to call the 
`metricsReporter` directly from `IcebergCatalogAdapter`. The benefit is 
avoiding non-functional changes in `catalog`. WDYT?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to