CCweixiao commented on code in PR #6995:
URL: https://github.com/apache/hbase/pull/6995#discussion_r2126697816
##########
hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/metrics/impl/GlobalMetricRegistriesAdapter.java:
##########
@@ -126,6 +127,20 @@ private void doRun() {
continue;
}
+ // To determine whether a new MetricRegistry is created in registries,
+ // Need to remove the old MetricRegistry in registeredSources for the
new MetricRegistry
+ // https://issues.apache.org/jira/browse/HBASE-29322
+ MetricsSourceAdapter registeredSource = registeredSources.get(info);
+ if (registeredSource != null &&
!Objects.equals(registeredSource.registry, registry)) {
+ registeredSources.remove(info);
+ synchronized (DefaultMetricsSystem.instance()) {
Review Comment:
It seems unnecessary. I'll adjust the code
--
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]