如何编写“仅地图"hadoop 作业? [英] How to write 'map only' hadoop jobs?

查看:15
本文介绍了如何编写“仅地图"hadoop 作业?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 hadoop 的新手,我对 map-reduce 编程的风格很熟悉,但现在我遇到了一个问题:有时我只需要 map 的工作,我只需要直接将 map 结果作为输出,这意味着这里不需要减少阶段,我怎样才能做到这一点?

I'm a novice on hadoop, I'm getting familiar to the style of map-reduce programing but now I faced a problem : Sometimes I need only map for a job and I only need the map result directly as output, which means reduce phase is not needed here, how can I achive that?

推荐答案

这会关闭reducer.

This turns off the reducer.

job.setNumReduceTasks(0);

http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/Job.html#setNumReduceTasks(int)

这篇关于如何编写“仅地图"hadoop 作业?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆