@Override
  public void clear() {
    registries.values().stream()
        .map(IoTDBMetricRegistry.class::cast)
        .forEach(IoTDBMetricRegistry::removeAll);
    this.registries.clear();
  }
Using RefCountingMap here because of potential duplicate MetricRegistryInfos.
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/metrics/MetricRegistryManager.java