reducer类可能不会被启动吗?在reducer日志中看不到sytem.out.println语句

x6h2sr28  于 2021-06-02  发布在  Hadoop
关注(0)|答案(2)|浏览(283)

我有一个驱动程序类,Map器类和还原器类。mapreduce作业运行良好。但期望的结果却没有出现。我已经把system.out.println语句放进了减速机。我查看了mapper和reducer的日志。我放在mapper中的system.out.println语句可以在日志中看到,但是reducer中的println语句在日志中看不到。有没有可能减速机根本就没有启动?
这是减速机的原木。

rqdpfwrv

rqdpfwrv1#

代码没有变化。现在可以了。我所做的只是重新启动了hadoopcloudera映像,现在可以正常工作了。真不敢相信会发生这种事。

u59ebvdq

u59ebvdq2#

我假设这个问题是基于前面问题中的代码:mapreduce composite key sample-没有显示所需的输出

public  class CompositeKeyReducer extends Reducer<Country, IntWritable, Country, IntWritable> {

    public void reduce(Country key, Iterator<IntWritable> values, Context context) throws IOException, InterruptedException {

    }
}

reduce没有运行,因为 reduce 方法签名错误。您有: public void reduce(Country key, Iterator<IntWritable> values, Context context) 应该是: public void reduce(Country key, Iterable<IntWritable> values, Context context) 为了确保这种情况不再发生,您应该添加 @Override 类的注解。如果你的签名错了,这会告诉你的。

相关问题