JMXUtils.java 文件源码

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

项目:bagri 作者:
/**
    * Aggregates two tabular structures into one. 
    * 
    * @param source the source tabular
    * @param target the target tabular
    * @param aggregator the aggregator which will perform data aggregation 
    * @return the aggregated tabular structure
    */
@SuppressWarnings({ "rawtypes", "unchecked" })
public static TabularData aggregateStats(TabularData source, TabularData target, StatsAggregator aggregator) {
       logger.debug("aggregateStats.enter; got source: {}", source);
       if (source == null) {
        return target;
       }
    TabularData result = new TabularDataSupport(source.getTabularType());
       Set<List> keys = (Set<List>) source.keySet();
    if (target == null) {
        return source;
    } else {
            for (List key: keys) {
                Object[] index = key.toArray();
                CompositeData aggr = aggregateStats(source.get(index), target.get(index), aggregator);
                result.put(aggr);
        }
    }
       logger.debug("aggregateStats.exit; returning: {}", result);
    return result;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号