XPathApplierReducer.java 文件源码

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

项目:alfred-mpi 作者:
@Override
public void reduce(Text key, Iterable<MapWritable> listOfMaps, Context context) throws IOException, InterruptedException {

    for (MapWritable partialResultMap : listOfMaps) {
        for (Writable attributeText : partialResultMap.keySet()) {
            MapWritable partialInsideMap = (MapWritable) partialResultMap.get(attributeText);
            MapWritable partialOutputMap = new MapWritable();

            for (Writable rule : partialInsideMap.keySet()) {
                Text regola = (Text) rule;
                Text valore = (Text) partialInsideMap.get(rule);

                partialOutputMap.put(new Text(regola.toString()), new Text(valore.toString()));
            }

            result.put((Text)attributeText, partialOutputMap);
        }
    }

    context.write(key,result);       
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号