今天在看关于Hadoop(版本0.20.2)的内置数据输入格式的时候看见了KeyValueTextInputFormat,于是就想试试这个类,下面是代码[mw_shl_code=java,true]Configuration conf=new Configuration();
String [] arg=new GenericOptionsParser(conf,args).getRemainingArgs();
conf.set("key.value.separator.in.input.line",",");
Job job=new Job(conf,"Index");
job.setJarByClass(test9.class);
job.setMapperClass(Map.class);
job.setReducerClass(Reduce.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(Text.class);
job.setInputFormatClass(KeyValueTextInputFormat.class);
FileInputFormat.addInputPath(job, new Path(arg[0]));
FileOutputFormat.setOutputPath(job, new Path(arg[1]));
System.exit(job.waitForCompletion(true)?0:1); [/mw_shl_code]
然后ecplise报错:The method setInputFormatClass(Class<? extends InputFormat>) in the type Job is not applicable for the arguments
(Class<KeyValueTextInputFormat>)
http://lucene.472066.n3.nabble.com/No-KeyValueTextInputFormat-in-hadoop-0-20-2-td894459.html
https://issues.apache.org/jira/browse/MAPREDUCE-655
倒是看完了上面的两个帖子,但是还是不知道怎么回事啊.
|
|