hadoop-0.20.2版本:
public int run(String[] args) throws Exception {
Configuration conf = getConf();
JobConf job = new JobConf(conf, TestSdfInputFormat.class);
Path in = new Path(args[0]);
Path out = new Path(args[1]);
FileInputFormat.setInputPaths(job, in);
FileOutputFormat.setOutputPath(job, out);
job.setJobName("TestSdfInputFormat");
job.setMapperClass(MapClass.class);
job.setNumReduceTasks(0);.//设置Reduce个数为0
job.setInputFormat(SdfTextInputFormat.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(Text.class);
JobClient.runJob(job);
return 0;
}
hadoop-1.0.0版本:
public static void main(String[] args)