abstractdog commented on code in PR #4630:
URL: https://github.com/apache/hive/pull/4630#discussion_r1316835309
##########
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/common/metrics/metrics2/CodahaleMetrics.java:
##########
@@ -414,6 +415,9 @@ private boolean initCodahaleMetricsReporterClasses() {
try {
// Note: Hadoop metric reporter does not support tags. We create a
single reporter for all metrics.
Constructor<?> constructor = name.getConstructor(MetricRegistry.class,
Configuration.class);
+ if (name.getName().equals(Metrics2Reporter.class.getName())) {
+ DefaultMetricsSystem.shutdown();
Review Comment:
please put a code comment about this to clarify: why is it needed and how is
it exactly achieving what you want:
1. Metrics2Reporter is added in a previous loop...
2. So it's already initialized, so DefaultMetricsSystem is already running
3. shutdown and continue
what happens while adding it the first time? shutdown is a no-op? wouldn't
be easier just to make reporterClasses to a unique collection like Set? would
it be handling this case more easily and cleanly?
--
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]