jackye1995 commented on a change in pull request #4254:
URL: https://github.com/apache/iceberg/pull/4254#discussion_r818207509
##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java
##########
@@ -117,15 +120,22 @@ public void initialize(Map<String, String> properties) {
}
// Report Hadoop metrics if Hadoop is available
- try {
- DynConstructors.Ctor<MetricsContext> ctor =
-
DynConstructors.builder(MetricsContext.class).hiddenImpl(DEFAULT_METRICS_IMPL,
String.class).buildChecked();
- this.metrics = ctor.newInstance("s3");
-
- metrics.initialize(properties);
- } catch (NoSuchMethodException | ClassCastException e) {
- LOG.warn("Unable to load metrics class: '{}', falling back to null
metrics", DEFAULT_METRICS_IMPL, e);
+ String metricsImpl = properties.getOrDefault(
+ CatalogProperties.IO_METRICS_IMPL,
CatalogProperties.IO_METRICS_IMPL_DEFAULT);
+
+ ImmutableMap<String, String> metricContextProperties;
Review comment:
should never use concrete class for map as the type.
Also can just use `Map<String, String> metricContextProperties = properties`
and use a single if statement.
--
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]