我正在尝试使用自定义记录读取器,映射器和reducer设置一个简单的mapReduce应用程序。直到(包括)映射器似乎都可以工作(调用context.write时,我在控制台上写出了键-值对以进行测试)。
然后我得到消息



但是之后,我每3秒进入一个无限循环



没有详细的消息或其他任何内容。

当在我的IDE中启用日志记录所有异常时,上面的每条消息后都会出现以下异常:



我在作业的配置中定义了映射器和化简器,但是似乎找不到化简器类(?)。在 reducer 内创建了一个断点,该程序永远不会到达这一行。

我的pom.xml:

        <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-hadoop</artifactId>
        <version>1.0.2.RELEASE</version>
        </dependency>

和我的工作:
    Job job = new Job(new Configuration());
    job.setOutputKeyClass(IntWritable.class);
    job.setOutputValueClass(Text.class);
    job.setMapOutputKeyClass(IntWritable.class);
    job.setMapOutputValueClass(IntWritable.class);
    job.setMapperClass(DataFileMapper.class);
    job.setReducerClass(DataFileReducer.class);
    job.setInputFormatClass(HourBlockInputFormat.class);

    FileInputFormat.addInputPath(job, new Path("..."));
    FileOutputFormat.setOutputPath(job, new Path("..."));
    job.submit();

如有任何建议,我们将不胜感激,
最好

最佳答案

我遇到了同样的错误(无限循环)。我通过更新pom.xml文件解决了。

<dependencies>
    <dependency>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-mapreduce-client-common</artifactId>
        <version>2.7.1</version>
    </dependency>
<dependencies>

在我的pom.xml文件中添加以上依赖项。可能会对您有帮助。对我来说,它解决了问题。

如有任何疑问,请发表评论。

08-18 12:27
查看更多