mystic-lama commented on code in PR #8359:
URL: https://github.com/apache/iceberg/pull/8359#discussion_r1299454214
##########
aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java:
##########
@@ -379,21 +379,23 @@ public void initialize(Map<String, String> props) {
}
}
+ initMetrics(properties);
+ }
+
+ @SuppressWarnings("CatchBlockLogException")
+ private void initMetrics(Map<String, String> props) {
// Report Hadoop metrics if Hadoop is available
try {
DynConstructors.Ctor<MetricsContext> ctor =
DynConstructors.builder(MetricsContext.class)
- .loader(S3FileIO.class.getClassLoader())
.hiddenImpl(DEFAULT_METRICS_IMPL, String.class)
.buildChecked();
MetricsContext context = ctor.newInstance("s3");
- context.initialize(properties);
+ context.initialize(props);
this.metrics = context;
} catch (NoClassDefFoundError | NoSuchMethodException | ClassCastException
e) {
LOG.warn(
- "Unable to load metrics class: '{}', falling back to null metrics",
- DEFAULT_METRICS_IMPL,
- e);
+ "Unable to load metrics class: '{}', falling back to null metrics",
DEFAULT_METRICS_IMPL);
Review Comment:
Does it make sense to make it error, so that user may know it's not working
and it's using a default. This is in case some corrective action needs to be
taken.
Just a thought, 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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]