DistCache.java 文件源码

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

项目:TopPI 作者:
private static TIntIntMap readIntIntMap(URI[] files, Configuration conf, String token, int size) throws IOException {
    TIntIntMap map = new TIntIntHashMap(size, Constants.DEFAULT_LOAD_FACTOR, -1, -1);
    for (URI file : files) {
        if (file.getPath().contains(token)) {
            SequenceFile.Reader reader = new SequenceFile.Reader(conf, Reader.file(new Path(file)));
            IntWritable key = new IntWritable();
            IntWritable value = new IntWritable();

            while (reader.next(key, value)) {
                map.put(key.get(), value.get());
            }

            reader.close();
        }
    }

    return map;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号