找不到matrix2

来源:3-4 mapreduce实现矩阵相乘(3)

hyonline_

2018-05-15 16:24

请问有源代码吗?

写回答 关注

3回答

  • 珏子
    2018-05-16 23:30:37
    已采纳

    出现了java.io.FileNotFoundException: matrix2 的错误

     修改mapper2

    @Override

    protected void setup(Context context) throws IOException, InterruptedException {

    super.setup(context);

    //通过输入流将全局缓存变量中的 右侧矩阵 读入List<String>中

    Configuration conf = context.getConfiguration();

          

    FileSystem fs = FileSystem.get(conf);

    FSDataInputStream in = fs.open(new Path("/matrix/step1_output/part-r-00000"));

            //FileReader fr = new FileReader(itermOccurrenceMatrix);

    BufferedReader br = new BufferedReader(new InputStreamReader(in));

    //每一行的格式是: 行 tab 列_值,列_值,列_值,列_值

    String line = null;

    while((line = br.readLine())!=null) {

    cacheList.add(line);

    }

    in.close();

    br.close();

    }


    陆米 回复hyonli...

    这里是map启动前就读从hdfs读一次,如果做了缓存就是从节点的本地文件系统读。

    2019-01-11 00:52:45

    共 2 条回复 >

  • 五行_缺钱
    2019-05-21 19:13:36

    tql,就是有点搞不懂为什么原来不行

  • BannerTan
    2018-05-19 17:56:56

    能行。

Hadoop进阶

MapReduce原理,并实现简单的推荐

24236 学习 · 72 问题

查看课程

相似问题