MapReduce中的类以及超类:
package wordcount;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.FileInputFormat;
import org.apache.hadoop.mapred.FileOutputFormat;
import org.apache.hadoop.mapreduce.Job;
public class WordCount {
public static void main(String[] args) throws IOException {
//设置配置文件
Configuration conf = new Configuration();
Job job = Job.getInstance(conf);
//设置输入的路径
Path filein = new Path("dfdd");
FileInputFormat.addInputPath(job, filein );
//设置输出的路径
Path fileout = new Path("kdfslk");
//如果这个输出的路径已经存在,那么就把它删除
if(fileout.getFileSystem(conf).exists(fileout)) {
fileout.getFileSystem(conf).delete(fileout,true);
}
FileOutputFormat.setOutputPath(job,