Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#2 CountKmers.java ver 3 does not support Hadoop 0.19.0

open
nobody
None
5
2008-12-27
2008-12-27
Learner
No

The current source code for CountKmers.java version 3 does not support Hadoop 0.19.0.

$ javac -d . CountKmers.java
CountKmers.java:176: cannot find symbol
symbol : method addInputPath(org.apache.hadoop.fs.Path)
location: class org.apache.hadoop.mapred.JobConf
conf.addInputPath(new Path(inpath));;
^
CountKmers.java:194: cannot find symbol
symbol : method setOutputPath(org.apache.hadoop.fs.Path)
location: class org.apache.hadoop.mapred.JobConf
conf.setOutputPath(oPath);
^
2 errors

The above errors can be corrected. Line 176, change
conf.addInputPath(new Path(inpath));;
to
FileInputFormat.addInputPath(conf, new Path(inpath));

Line 194, change
conf.setOutputPath(oPath);
to
FileOutputFormat.setOutputPath(conf, oPath);

Add the following imports:
import org.apache.hadoop.mapred.FileInputFormat;
import org.apache.hadoop.mapred.FileOutputFormat;

Discussion