本帖最后由 a3087661 于 2015-4-24 17:06 编辑
Configuration conf = new Configuration();
String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();
if (otherArgs.length != 2) {
System.err.println("Usage: wordcount <in> <out>");
System.exit(2);
}
Job job = new Job(conf, "ReduceSideJoin");
job.setJarByClass(ReduceSideJoin.class);
job.setMapperClass(MyMapper.class);
//job.setCombinerClass(MyReducer.class);
job.setReducerClass(MyReduce.class);
job.setOutputKeyClass(IntWritable.class);
job.setOutputValueClass(Person.class);
FileInputFormat.addInputPath(job, new Path(otherArgs[0])); //报错
FileOutputFormat.setOutputPath(job, new Path(otherArgs[1]));//报错
System.exit(job.waitForCompletion(true) ? 0 : 1);
报错:Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The method addInputPath(JobConf, Path) in the type FileInputFormat is not applicable for the arguments (Job, Path)
The method setOutputPath(JobConf, Path) in the type FileOutputFormat is not applicable for the arguments (Job, Path) |
|