MetricsConfig.java 文件源码

java
阅读 53 收藏 0 点赞 0 评论 0

项目:hadoop 作者:
/**
 * Return sub configs for instance specified in the config.
 * Assuming format specified as follows:<pre>
 * [type].[instance].[option] = [value]</pre>
 * Note, '*' is a special default instance, which is excluded in the result.
 * @param type  of the instance
 * @return  a map with [instance] as key and config object as value
 */
Map<String, MetricsConfig> getInstanceConfigs(String type) {
  Map<String, MetricsConfig> map = Maps.newHashMap();
  MetricsConfig sub = subset(type);

  for (String key : sub.keys()) {
    Matcher matcher = INSTANCE_REGEX.matcher(key);
    if (matcher.matches()) {
      String instance = matcher.group(1);
      if (!map.containsKey(instance)) {
        map.put(instance, sub.subset(instance));
      }
    }
  }
  return map;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号