You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "mystic-lama (via GitHub)" <gi...@apache.org> on 2023/08/20 23:41:17 UTC
[GitHub] [iceberg] mystic-lama commented on a diff in pull request #8359: FileIO: Skip stack trace log for missing Hadoop
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: 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