简体   繁体   English

Hadoop 2.2.0配置弃用

[英]Hadoop 2.2.0 Configuration deprecation

I set up the Hadoop 2.2.0 Cluster and now running my java client to process data. 我设置了Hadoop 2.2.0集群,现在运行我的java客户端来处理数据。 After running my java program, I notice the output displays like this: 运行我的java程序后,我注意到输出显示如下:

13/11/18 11:44:44 INFO Configuration.deprecation: user.name is deprecated. Instead, use mapreduce.job.user.name
13/11/18 11:44:44 INFO Configuration.deprecation: mapred.jar is deprecated. Instead, use mapreduce.job.jar 
13/11/18 11:44:44 INFO Configuration.deprecation: mapred.output.value.class is deprecated. Instead, use mapreduce.job.output.value.class
13/11/18 11:44:44 INFO Configuration.deprecation: mapreduce.combine.class is deprecated. Instead, use mapreduce.job.combine.class
13/11/18 11:44:44 INFO Configuration.deprecation: mapreduce.map.class is deprecated. Instead, use mapreduce.job.map.class
13/11/18 11:44:44 INFO Configuration.deprecation: mapred.job.name is deprecated. Instead, use mapreduce.job.name
13/11/18 11:44:44 INFO Configuration.deprecation: mapred.textoutputformat.separator is deprecated. Instead, use mapreduce.output.textoutputformat.separator
13/11/18 11:44:44 INFO Configuration.deprecation: mapreduce.reduce.class is deprecated. Instead, use mapreduce.job.reduce.class 
13/11/18 11:44:44 INFO Configuration.deprecation: mapred.input.dir is deprecated. Instead, use mapreduce.input.fileinputformat.inputdir
13/11/18 11:44:44 INFO Configuration.deprecation: mapred.output.dir is deprecated. Instead, use mapreduce.output.fileoutputformat.outputdir
13/11/18 11:44:44 INFO Configuration.deprecation: mapred.map.tasks is deprecated. Instead, use mapreduce.job.maps
13/11/18 11:44:44 INFO Configuration.deprecation: mapred.output.key.class is deprecated. Instead, use mapreduce.job.output.key.class
13/11/18 11:44:44 INFO Configuration.deprecation: mapred.working.dir is deprecated. Instead, use mapreduce.job.working.dir

The module is working well and looks like that doesn't affect anything. 该模块运行良好,看起来不会影响任何事情。 But how can I avoid this info messages? 但是我该如何避免这些信息消息呢? (I import maven hadoop-client 2.2.0 and use Job job = new Job()) (我导入maven hadoop-client 2.2.0并使用Job job = new Job())

它已在Hadoop 2.3中修复,请参考: https//issues.apache.org/jira/browse/HADOOP-10178

Most are because of the Hadoop API change - all of the "mapred" package are moved to "mapreduce". 大多数是因为Hadoop API更改 - 所有“mapred”包都被移动到“mapreduce”。 You can change where you import "org.apache.hadoop.mapred" to "org.apache.hadoop.mapreduce" to avoid such information. 您可以更改将“org.apache.hadoop.mapred”导入“org.apache.hadoop.mapreduce”的位置以避免此类信息。 You could do similar change for some other messages such as 您可以对其他一些消息进行类似的更改,例如

13/11/18 11:44:44 INFO Configuration.deprecation: user.name is deprecated. Instead, use mapreduce.job.user.name

Deprecated means that these APIs are still there but they will be removed in future releases. 不推荐使用意味着这些API仍然存在但在将来的版本中将被删除。 The mapred namespace is old and the new mapreduce namespace has been added to replace it. mapred命名空间是旧的,并且添加了新的mapreduce命名空间来替换它。

As the info messages and Zhutoulala mentioned if you want to avoid these you need to use the new API instead of the old one. 正如信息消息和Zhutoulala所提到的,如果你想避免这些,你需要使用新API而不是旧API。 The new API is org.apache.hadoop.mapreduce . 新的API是org.apache.hadoop.mapreduce By the way, the "new" API is there since 2009. You can see this presentation for the changes 顺便说一句,自2009年以来,“新”API就在那里。您可以看到此演示文稿的变化

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM