@InterfaceAudience.Private public final class GlobalMetricRegistriesAdapter extends Object
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
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.
Modifier and Type | Method and Description |
---|---|
static GlobalMetricRegistriesAdapter |
init()
Make sure that this global MetricSource for hbase-metrics module based metrics are initialized.
|
void |
stop() |
public static GlobalMetricRegistriesAdapter init()
public void stop()
Copyright © 2007–2019 Cloudera. All rights reserved.