Package org.apache.hadoop.metrics2.util
Class MetricsCache
java.lang.Object
org.apache.hadoop.metrics2.util.MetricsCache
A metrics cache for sinks that don't support sparse updates.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classorg.apache.hadoop.metrics2.util.MetricsCache.RecordCached record -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.metrics2.util.MetricsCache.Recordget(String name, Collection<MetricsTag> tags) Get the cached recordorg.apache.hadoop.metrics2.util.MetricsCache.Recordupdate(MetricsRecord mr) Update the cache and return the current cache recordorg.apache.hadoop.metrics2.util.MetricsCache.Recordupdate(MetricsRecord mr, boolean includingTags) Update the cache and return the current cached record
-
Constructor Details
-
MetricsCache
public MetricsCache() -
MetricsCache
public MetricsCache(int maxRecsPerName) Construct a metrics cache- Parameters:
maxRecsPerName- limit of the number records per record name
-
-
Method Details
-
update
public org.apache.hadoop.metrics2.util.MetricsCache.Record update(MetricsRecord mr, boolean includingTags) Update the cache and return the current cached record- Parameters:
mr- the update recordincludingTags- cache tag values (for later lookup by name) if true- Returns:
- the updated cache record
-
update
Update the cache and return the current cache record- Parameters:
mr- the update record- Returns:
- the updated cache record
-
get
public org.apache.hadoop.metrics2.util.MetricsCache.Record get(String name, Collection<MetricsTag> tags) Get the cached record- Parameters:
name- of the recordtags- of the record- Returns:
- the cached record or null
-