hadoop - 在hadoop中链接mapreduce作业

标签 hadoop mapreduce

我是Hadoop的新手。我的任务是找到最高薪水的雇员。
在我的firstmap类中,我拆分了单词,然后将键和值放置如下:

outputcollector.collect("salary",salary);

在我的 reducer 中,我找到了最高薪水,并设置了这样的输出
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 没有执行。有什么帮助吗?

最佳答案

您需要为单个映射/缩小作业为映射器和缩减器创建并设置相同的JobConf。

关于hadoop - 在hadoop中链接mapreduce作业,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18278633/

相关文章:

java - MapReduce Hadoop 运行时字符串异常

java - Map 中的 Pair 类减少抛出错误

java - 在Eclipse中运行mapreduce程序时出错

hadoop - 从多个服务器加载数据时避免数据重复

hadoop - 运行HBase映射时的ClassNotFoundException减少群集上的作业

sorting - 我如何使用mapreduce在hadoop集群上实现自适应mergesort

hadoop - MapReduce 和 Hive 应用程序设计

mongodb - 在 MongoDB map-reduce 中计算距离

hadoop - 什么时候需要 "no mapper"?

hadoop - Apache PIG-将毫秒转换为TimeStamp Unix