You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "nastra (via GitHub)" <gi...@apache.org> on 2023/04/13 12:21:55 UTC

[GitHub] [iceberg] nastra commented on a diff in pull request #7337: Core: Support loading multiple metrics reporters

nastra commented on code in PR #7337:
URL: https://github.com/apache/iceberg/pull/7337#discussion_r1165443158


##########
core/src/main/java/org/apache/iceberg/CatalogUtil.java:
##########
@@ -448,4 +475,46 @@ public static MetricsReporter loadMetricsReporter(Map<String, String> properties
 
     return reporter;
   }
+
+  static class CompositeMetricsReporter implements MetricsReporter {

Review Comment:
   @rdblue as we discussed I've made this an inner class. However, we could consider moving the class out of `CatalogUtil` and replace https://github.com/apache/iceberg/blob/master/core/src/main/java/org/apache/iceberg/TableScanContext.java#L359-L366 with a `CompositeMetricsReporter`.
   
   For cases where we'd like to use multiple reporters during scans
   ```
   TableScan tableScan = table
           .newScan()
           .metricsReporter(...)
           .metricsReporter(...)
           .metricsReporter(...);
   ```
   we would internally instantiate a `CompositeMetricsReporter` in `TableScanContext#reportWith(..)` and then have `TableScanContext#metricsReporter()` return `MetricsReporter` rather than `Collection<MetricsReporter>`.



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org