问答详情
源自:3-4 mapreduce实现矩阵相乘(3)

找不到matrix2

请问有源代码吗?

提问者:hyonline_ 2018-05-15 16:24

个回答

  • 珏子
    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();

    }


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

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

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

    能行。