pvary commented on code in PR #16155:
URL: https://github.com/apache/iceberg/pull/16155#discussion_r3163085413


##########
flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergStreamWriterMetrics.java:
##########
@@ -97,4 +107,55 @@ public Counter getFlushedDataFiles() {
   public Counter getFlushedDeleteFiles() {
     return flushedDeleteFiles;
   }
+
+  @Nullable
+  Histogram dataFilesSizeHistogram() {
+    return dataFilesSizeHistogram;
+  }
+
+  @Nullable
+  Histogram deleteFilesSizeHistogram() {
+    return deleteFilesSizeHistogram;
+  }
+
+  static Histogram loadHistogramIfAvailable(
+      MetricGroup group, String name, int reservoirSize, ClassLoader 
classLoader) {
+
+    if (isFlinkDropwizardAvailable(classLoader)) {

Review Comment:
   Maybe like this:
   ```suggestion
       try {
         Class.forName(
             "org.apache.flink.dropwizard.metrics.DropwizardHistogramWrapper", 
false, classLoader);
         return HistogramLoader.load(name, group, reservoirSize);
       } catch (ClassNotFoundException e) {
         LOG.warn(
             "flink-metrics-dropwizard is not on the classpath. '{}' histogram 
metrics will be disabled. Add org.apache.flink:flink-metrics-dropwizard to 
enable them.",
             name);
         return null;
       }
   ```



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to