public static void clearJmxCache() {
    if (LOG.isTraceEnabled()) {
      LOG.trace("clearing JMX Cache" + StringUtils.stringifyException(new Exception()));
    }
    // If there are more then 100 ms before the executor will run then everything should be merged.
    ScheduledFuture future = fut.get();
    if ((future != null && (!future.isDone() && future.getDelay(TimeUnit.MILLISECONDS) > 100))) {
      // BAIL OUT
      return;
    }
    if (stopped.get()) {
      return;
    }
    future = executor.getExecutor().schedule(new JmxCacheBusterRunnable(), 5, TimeUnit.SECONDS);
    fut.set(future);
  }
For JMX to forget about all previously exported metrics.
hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics2/impl/JmxCacheBuster.java