简体   繁体   English

杀死Hadoop 2.2.0配置弃用信息消息的确切步骤

[英]Exact steps to kill Hadoop 2.2.0 Configuration deprecation info messages

This question is similar to Hadoop 2.2.0 Configuration deprecation , but the answers to that question did not resolve the issue, so I am asking for specific steps in this question, and providing a specific example. 此问题类似于Hadoop 2.2.0配置弃用 ,但该问题的答案并未解决问题,因此我要求在此问题中提供具体步骤,并提供具体示例。

Consider the following short Map-only program: 请考虑以下简短的Map-only计划:

import java.io.IOException;
import java.util.*;

import org.apache.hadoop.fs.Path;
import org.apache.hadoop.conf.*;
import org.apache.hadoop.io.*;
import org.apache.hadoop.mapreduce.*;
import org.apache.hadoop.mapreduce.lib.input.*;
import org.apache.hadoop.mapreduce.lib.output.*;
import org.apache.hadoop.mapreduce.lib.*;
import org.apache.hadoop.util.*;


public class Foo {

    //     KEYIN,VALUEIN,KEYOUT,VALUEOUT
    public static class Map extends  Mapper<LongWritable, Text, Text, IntWritable> {
        private final static IntWritable one = new IntWritable(1);
        private Text word = new Text();

        public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
            String line = value.toString();
            StringTokenizer tokenizer = new StringTokenizer(line);
            while (tokenizer.hasMoreTokens()) {
                word.set(tokenizer.nextToken());
                context.write(word, one);
            }
        }
    }

    public static void main(String[] args) throws Exception {
        org.apache.hadoop.mapreduce.Job job = Job.getInstance();
        job.setJarByClass(Foo.class);
        job.setInputFormatClass(TextInputFormat.class);
        job.setOutputFormatClass(TextOutputFormat.class);
        job.setMapperClass(Map.class);

        job.setMapOutputKeyClass(Text.class);
        job.setMapOutputValueClass(IntWritable.class);

        FileInputFormat.addInputPath(job, new Path(args[0]));
        FileOutputFormat.setOutputPath(job, new Path(args[1]));
        System.exit(job.waitForCompletion(true)?0:1);
    }
}

When this code is run against the input: 当针对输入运行此代码时:

The big brown cat went down the lazy road. 

Using the command line below, assuming that the Input contains the input above. 使用下面的命令行,假设Input包含上面的输入。

hadoop jar Foo.jar Foo Input Output 

The following messages will appear: 将显示以下消息:

  4/01/19 18:37:36 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8032
14/01/19 18:37:37 WARN mapreduce.JobSubmitter: Hadoop command-line option parsing not performed. Implement the Tool interface and execute your application with ToolRunner to remedy this.
14/01/19 18:37:38 INFO input.FileInputFormat: Total input paths to process : 1
14/01/19 18:37:38 INFO mapreduce.JobSubmitter: number of splits:1
14/01/19 18:37:38 INFO Configuration.deprecation: user.name is deprecated. Instead, use mapreduce.job.user.name
14/01/19 18:37:38 INFO Configuration.deprecation: mapred.jar is deprecated. Instead, use mapreduce.job.jar
14/01/19 18:37:38 INFO Configuration.deprecation: mapred.mapoutput.value.class is deprecated. Instead, use mapreduce.map.output.value.class
14/01/19 18:37:38 INFO Configuration.deprecation: mapreduce.map.class is deprecated. Instead, use mapreduce.job.map.class
14/01/19 18:37:38 INFO Configuration.deprecation: mapred.job.name is deprecated. Instead, use mapreduce.job.name
14/01/19 18:37:38 INFO Configuration.deprecation: mapreduce.inputformat.class is deprecated. Instead, use mapreduce.job.inputformat.class
14/01/19 18:37:38 INFO Configuration.deprecation: mapred.input.dir is deprecated. Instead, use mapreduce.input.fileinputformat.inputdir
14/01/19 18:37:38 INFO Configuration.deprecation: mapred.output.dir is deprecated. Instead, use mapreduce.output.fileoutputformat.outputdir
14/01/19 18:37:38 INFO Configuration.deprecation: mapreduce.outputformat.class is deprecated. Instead, use mapreduce.job.outputformat.class
14/01/19 18:37:38 INFO Configuration.deprecation: mapred.map.tasks is deprecated. Instead, use mapreduce.job.maps
14/01/19 18:37:38 INFO Configuration.deprecation: mapred.mapoutput.key.class is deprecated. Instead, use mapreduce.map.output.key.class
14/01/19 18:37:38 INFO Configuration.deprecation: mapred.working.dir is deprecated. Instead, use mapreduce.job.working.dir

The example above uses only org.apache.hadoop.mapreduce , and I used the powerpoint that was linked to create it. 上面的例子只使用了org.apache.hadoop.mapreduce ,我使用了链接的powerpoint来创建它。

What exactly needs to be changed (either in this code or in /etc/hadoop ) to make the deprecation messages go away? 究竟需要更改什么(在此代码中或在/etc/hadoop )才能使弃用消息消失?

It was fixed in later version of Apache Hadoop - https://issues.apache.org/jira/browse/HADOOP-10178 它已在更高版本的Apache Hadoop中修复 - https://issues.apache.org/jira/browse/HADOOP-10178

You can just upgrade your Apache Hadoop cluster or apply patches and re-build it. 您可以升级Apache Hadoop集群或应用补丁并重新构建它。

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

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