大数据hadoop,招聘数据分析,图书数据分析,echarts
https://download.csdn.net/download/qq_31293575/14927877package com.qf.game.task2;import org.apache.hadoop.conf.Configuration;import org.apache.hadoop.fs.Path;import org.apache.hadoop.io.*;import org.a
·
https://download.csdn.net/download/qq_31293575/14928183
package com.qf.game.task2;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.*;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
public class Main {
public static void main(String[] args) throws Exception {
Configuration conf=new Configuration();
Job job = Job.getInstance(conf);
job.setJarByClass(Main.class);
job.setMapperClass(map.class);
job.setReducerClass(red.class);
job .setOutputKeyClass(NullWritable.class);
job.setOutputValueClass(Text.class);
// hdfs://master:9000/test/
// FileInputFormat.addInputPath(job,new Path("hdfs:/data/task2-Crawler"));
FileInputFormat.addInputPath(job,new Path("hdfs://192.168.88.138:9000/data/task2-Crawler"));
FileOutputFormat.setOutputPath(job,new Path("hdfs://192.168.88.138:9000/clean"));
new Path("hdfs://192.168.88.138:9000/data").getFileSystem(conf).delete(new Path("hdfs://192.168.88.138:9000/clean"),true);
System.exit(job.waitForCompletion(true) ? 0 : 1);
}
}
更多推荐
所有评论(0)