Package org.apache.hadoop.hbase.metrics
Class MetricRegistries
java.lang.Object
org.apache.hadoop.hbase.metrics.MetricRegistries
- Direct Known Subclasses:
MetricRegistriesImpl
MetricRegistries is collection of MetricRegistry's. MetricsRegistries implementations should do
ref-counting of MetricRegistry's via create() and remove() methods.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
clear()
Removes all the MetricRegisties.abstract MetricRegistry
create
(MetricRegistryInfo info) Create or return MetricRegistry with the given info.abstract Optional<MetricRegistry>
get
(MetricRegistryInfo info) Returns the MetricRegistry if found.abstract Collection<MetricRegistry>
Returns MetricRegistry's created.abstract Set<MetricRegistryInfo>
Returns MetricRegistryInfo's for the MetricRegistry's created.static MetricRegistries
global()
Return the global singleton instance for the MetricRegistries.abstract boolean
remove
(MetricRegistryInfo key) Decrements the ref count of the MetricRegistry, and removes if ref count == 0.
-
Constructor Details
-
MetricRegistries
public MetricRegistries()
-
-
Method Details
-
global
Return the global singleton instance for the MetricRegistries.- Returns:
- MetricRegistries implementation.
-
clear
Removes all the MetricRegisties. -
create
Create or return MetricRegistry with the given info. MetricRegistry will only be created if current reference count is 0. Otherwise ref counted is incremented, and an existing instance will be returned.- Parameters:
info
- the info object for the MetricRegistrytry.- Returns:
- created or existing MetricRegistry.
-
remove
Decrements the ref count of the MetricRegistry, and removes if ref count == 0.- Parameters:
key
- the info object for the MetricRegistrytry.- Returns:
- true if metric registry is removed.
-
get
Returns the MetricRegistry if found.- Parameters:
info
- the info for the registry.- Returns:
- a MetricRegistry optional.
-
getMetricRegistryInfos
Returns MetricRegistryInfo's for the MetricRegistry's created.- Returns:
- MetricRegistryInfo's for the MetricRegistry's created.
-
getMetricRegistries
Returns MetricRegistry's created.- Returns:
- MetricRegistry's created.
-