JMXGet.java 文件源码

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

项目:hadoop 作者:
/**
 * get single value by key
 */
public String getValue(String key) throws Exception {

  Object val = null;

  for (ObjectName oname : hadoopObjectNames) {
    try {
      val = mbsc.getAttribute(oname, key);
    } catch (AttributeNotFoundException anfe) {
      /* just go to the next */
      continue;
    } catch (ReflectionException re) {
      if (re.getCause() instanceof NoSuchMethodException) {
        continue;
      }
    }
    err("Info: key = " + key + "; val = " +
        (val == null ? "null" : val.getClass()) + ":" + val);
    break;
  }

  return (val == null) ? "" : val.toString();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号