@Override
    public void getMetrics(MetricsCollector collector, boolean all) {
      metricsAdapter.snapshotAllMetrics(registry, collector);
    }
This class acts as an adapter to export the MetricRegistry's in the global registry. Each
MetricRegistry will be registered or unregistered from the metric2 system. The collection will be
performed via the MetricsSourceAdapter and the MetricRegistry will collected like a BaseSource
instance for a group of metrics (like WAL, RPC, etc) with the MetricRegistryInfo's JMX context.
<p>
Developer note: Unlike the current metrics2 based approach, the new metrics approach
(hbase-metrics-api and hbase-metrics modules) work by having different MetricRegistries that are
initialized and used from the code that lives in their respective modules (hbase-server, etc).
There is no need to define BaseSource classes and do a lot of indirection. The MetricRegistry'es
will be in the global MetricRegistriesImpl, and this class will iterate over
MetricRegistries.global() and register adapters to the metrics2 subsystem. These adapters then
report the actual values by delegating to
{@link HBaseMetrics2HadoopMetricsAdapter#snapshotAllMetrics(MetricRegistry, MetricsCollector)}.
We do not initialize the Hadoop Metrics2 system assuming that other BaseSources already do so
(see BaseSourceImpl). Once the last BaseSource is moved to the new system, the metric2
initialization should be moved here.
</p>
hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/metrics/impl/GlobalMetricRegistriesAdapter.java