Abh*_*ngh 7 java hadoop mapreduce
嗨,我是Hadoop的新手,也是FileSystem.我看到两个不同的WordCount使用JobConf和的例子Configuration.它们有什么区别.
我研究过它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还是Configuration?
哪个更适合v1.0.4?mapred还是mapreduce?
如果查看发布页面,可以看到1.0.4对应于0.20.20x左右的内容
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.
Run Code Online (Sandbox Code Playgroud)
所以你可以看到,它主要是复古兼容性的问题.
所以最重要的是,如果你现在用1.0.4开始你的应用程序你应该使用mapreduce而不是mapred因为它现在是首选的方式,但如果你有遗留的应用程序,你仍然可以使用旧的mapred.这意味着你应该使用Configuration.
至于mapred和之间的区别mapreduce,正如上面的摘录中所解释的那样,它主要来自Context对象的引入,但是还有许多其他的变化和旧的类中没有的新类mapred.
| 归档时间: |
|
| 查看次数: |
2743 次 |
| 最近记录: |