zentol commented on a change in pull request #8002: [FLINK-11923][metrics]
MetricRegistryConfiguration provides MetricReporters Suppliers
URL: https://github.com/apache/flink/pull/8002#discussion_r270372880
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/metrics/MetricRegistryImpl.java
##########
@@ -144,11 +135,9 @@ public MetricRegistryImpl(MetricRegistryConfiguration
config) {
}
}
- Class<?> reporterClass =
Class.forName(className);
- MetricReporter reporterInstance =
(MetricReporter) reporterClass.newInstance();
+ final MetricReporter reporterInstance =
reporterSetup.getSupplier().get();
Review comment:
In FLINK-11922 I want do add support for reporter factories, with which
supported reporters would allocate resources in their constructor instead of
`open`. I don't want that to occur in the configuration, hence the supplier.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services