With new api, next method reads key and value into member variables, and the key and value read by next method can read by getCurrentKey() and getCurrentValue(). For example see LineRecoredReader, SequenceFileRecordReader in org.apache.hadoop.mapreduce.lib.input package.
Thanks Amareshwari On 8/24/10 5:58 PM, "Robin Anil" <[email protected]> wrote: +mahout-user On Tue, Aug 24, 2010 at 5:37 PM, Shuja Rehman <[email protected]> wrote: Hi I am trying to convert Mahout xmlInputFormat to new API but this is not working. The problem which i think is that in old api we have next method which takes key and value and we can set it in the method public boolean next(LongWritable key, Text value) throws IOException { but in new API, the method signature is public boolean nextKeyValue() So now i am not sure where i set key and values. Here is the link of xml Input format with old API http://grepcode.com/file/repo1.maven.org/maven2/org.apache.mahout/mahout-examples/0.2/org/apache/mahout/classifier/bayes/XmlInputFormat.java and i am attaching what i have done with it to convert it into new API so far. I am not sure about what i have done so far is correct. Kindly help me out to sort out the problem Thanks
