简体   繁体   中英

Hadoop 2.2.0 Configuration deprecation

I set up the Hadoop 2.2.0 Cluster and now running my java client to process data. After running my java program, I notice the output displays like this:

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())

它已在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". You can change where you import "org.apache.hadoop.mapred" to "org.apache.hadoop.mapreduce" to avoid such information. 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. The mapred namespace is old and the new mapreduce namespace has been added to replace it.

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. The new API is org.apache.hadoop.mapreduce . By the way, the "new" API is there since 2009. You can see this presentation for the changes

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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