加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java – Hadoop 1.0.4的JobConf v / s配置

发布时间:2020-12-14 06:03:33 所属栏目:Java 来源:网络整理
导读:嗨,我是Hadoop的新手,也是FileSystem.我使用JobConf和Configuration看到了两个不同的WordCount示例.它们有什么区别. 我研究过JobConf是旧包org.apache.hadoop.mapred(在0.20.x中弃用)的一部分,但Configuration是新包org.apache.hadoop.mapreduce的一部分.但
嗨,我是Hadoop的新手,也是FileSystem.我使用JobConf和Configuration看到了两个不同的WordCount示例.它们有什么区别.

我研究过JobConf是旧包org.apache.hadoop.mapred(在0.20.x中弃用)的一部分,但Configuration是新包org.apache.hadoop.mapreduce的一部分.但现在在v1.0.4中它是不推荐的.

目前我们有两种方法在java中运行map reduce作业,一种是在org.apache.hadoop.mapreduce包中使用(扩展)类,另一种是在org.apache.hadoop.mapred包中实现类.

我想知道:

> mapred和mapreduce包结构有什么区别以及为什么mapred不被弃用?
>哪种方法更适合v1.0.4使用?为什么? JobConf还是配置?
>哪个更适合v1.0.4? mapred还是mapreduce?

解决方法

如果你看一下 the releases page,你可以看到1.0.4对应于0.20.20x左右的东西

为了给出一些背景,这里讨论的是on the mailing list:

The "old" MapReduce API in org.apache.hadoop.mapred was deprecated in the 0.20 
release series when the "new" (Context Objects) MapReduce API was added in
org.apache.hadoop.mapreduce. Unfortunately,the new API was not complete in 0.20
and most users stayed with the old API. This has led to the confusing situation 
where the old API is generally recommended,even though it is deprecated.

所以你可以看到,它主要是复古兼容性的问题.

所以最重要的是,如果您现在使用1.0.4启动应用程序,则应使用mapreduce而不是mapred,因为它现在是首选方式,但如果您有遗留应用程序,仍然可以使用旧的mapred.这意味着您应该使用配置.

至于mapred和mapreduce之间的区别,正如上面的摘录中所解释的那样,它主要来自Context对象的引入,但是有一些其他的更改和新的类在旧的mapred中不可用.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读