@Singleton public class MetricDictionary extends ScopeMap<String,String,LogicalMetric,MetricDictionary>
At configuration time metrics are loaded into the metric dictionary, global by default: globalMetricDictionary.add(LogicalMetric) or for metrics within a single level of scope named "scope", either: globalMetricDictionary.putScope("scope", logicalMetric.getName(), logicalMetric) or MetricDictionary scopedDictionary = globalMetricDictionary.getScope("scope") scopedDictionary.add(logicalMetric) With more than one scope of nesting use: MetricDictionary scopedDictionary = globalMetricDictionary.getScope("scope1").getScope("scope2") or scopedDictionary = metricDictionary.getScope("scopeOuter", "scopeMiddle", "scopeInner") At queryTime: with scope "scope": metricDictionary = metricDictionary.get("scope") LogicalMetric lm = metricDictionary.get("key") will return values in both "scope" and in global scope.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
MetricDictionary()
Create a metric dictionary with global scope.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(LogicalMetric logicalMetric)
Add a logical metric to the dictionary.
|
protected MetricDictionary |
factory(MetricDictionary scope)
Used to construct child scopes.
|
clear, clearLocal, containsKey, containsValue, entrySet, equals, flatView, get, hashCode, keySet, put, remove, removeLocal, size, values
forEach, getOrDefault, removeEldestEntry, replaceAll
clone, compute, computeIfAbsent, computeIfPresent, isEmpty, merge, putAll, putIfAbsent, remove, replace, replace
toString
finalize, getClass, notify, notifyAll, wait, wait, wait
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
public MetricDictionary()
public boolean add(LogicalMetric logicalMetric)
logicalMetric
- Logical metric to addprotected MetricDictionary factory(MetricDictionary scope)
ScopeMap
factory
in class ScopeMap<String,String,LogicalMetric,MetricDictionary>
scope
- The parent scope for the scope being createdCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.