我设置了Hadoop 2.2.0群集,现在运行我的java客户端来处理数据。运行我的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
该模块运行良好,看起来不会影响任何事情。但是我该如何避免这些信息消息呢? (我导入maven hadoop-client 2.2.0并使用Job job = new Job())
答案 0 :(得分:1)
已在Hadoop 2.3中修复,请参阅:https://issues.apache.org/jira/browse/HADOOP-10178
答案 1 :(得分:0)
大多数是因为Hadoop API更改 - 所有“mapred”包都被移动到“mapreduce”。您可以更改将“org.apache.hadoop.mapred”导入“org.apache.hadoop.mapreduce”的位置以避免此类信息。您可以对其他一些消息进行类似的更改,例如
13/11/18 11:44:44 INFO Configuration.deprecation: user.name is deprecated. Instead, use mapreduce.job.user.name
答案 2 :(得分:0)
不推荐使用意味着这些API仍然存在但在将来的版本中将被删除。 mapred命名空间是旧的,并且添加了新的mapreduce命名空间来替换它。
正如信息消息和Zhutoulala所提到的,如果你想避免这些,你需要使用新API而不是旧API。新API为org.apache.hadoop.mapreduce
。顺便说一下," new"自2009年以来,API就在那里。您可以看到this presentation的更改