终止Hadoop2.2.0配置弃用信息消息的确切步骤

pes8fvy9  于 2021-06-03  发布在  Hadoop
关注(0)|答案(1)|浏览(256)

这个问题类似于hadoop2.2.0配置的弃用,但是这个问题的答案并没有解决这个问题,所以我要问这个问题的具体步骤,并提供一个具体的例子。
考虑以下简短的仅Map程序:

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);
    }
}

当对输入运行此代码时:

The big brown cat went down the lazy road.

使用下面的命令行,假设 Input 包含上面的输入。

hadoop jar Foo.jar Foo Input Output

将出现以下消息:

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

以上示例仅使用 org.apache.hadoop.mapreduce ,我使用链接的powerpoint创建了它。
到底需要更改什么(在本代码中或 /etc/hadoop )让那些反对的信息消失?

wr98u20j

wr98u20j1#

它在后来的apache hadoop版本中被修复了-https://issues.apache.org/jira/browse/hadoop-10178
你可以升级你的apachehadoop集群或者应用补丁重新构建它。

相关问题