【问题标题】:chaining mapreduce jobs in hadoop在hadoop中链接mapreduce作业
【发布时间】:2013-08-16 17:04:31
【问题描述】:

我是 Hadoop 新手。我的任务是找到一个薪水最高的员工。 在我的第一个地图类中,我将单词拆分并像这样放置键和值-

outputcollector.collect("salary",salary);

在我的减速器中,我找到了最高薪水,并设置了这样的输出

outputcollector.collect("max salary",maxsalary);

现在我想在另一个映射器中使用这个 reducer 的输出。 我已经构建了一个这样的链

JobConf mapAConf = new JobConf(false);
        ChainMapper.addMapper(conf, mymap.class, LongWritable.class, Text.class, Text.class, IntWritable.class, true, mapAConf); 

JobConf reduceConf = new JobConf(false);
        ChainReducer.setReducer(conf, myreduce.class, Text.class, IntWritable.class, Text.class, IntWritable.class, true, reduceConf);

JobConf mapCConf = new JobConf(false);
       ChainReducer.addMapper(conf, LastMapper.class, Text.class, IntWritable.class, Text.class, IntWritable.class, true, mapCConf);

但是reducer 没有被执行。有什么帮助吗?

【问题讨论】:

  • 您有任何错误堆栈跟踪吗?谢谢!
  • 没有错误..但是reducer没有执行

标签: hadoop mapreduce


【解决方案1】:

您需要为单个 Map/Reduce 作业的 mapper 和 reducer 创建和设置相同的 JobConf。

【讨论】:

    猜你喜欢
    • 2011-01-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多