hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bibek Paudel <eternalyo...@gmail.com>
Subject help with rewriting hadoop java code for new API: RecordReader getPos()
Date Wed, 27 Oct 2010 09:37:38 GMT
[Apologies for cross-posting]

HI all,
I am rewriting a hadoop java code for the new (0.20.2) API- the code
was originally written for versions <= 0.19.

1. What is the equivalent of getPos() method [0] of RecordReader ?

I read that in 0.20, the getPos() methos is no longer there [1], but what
am I supposed to replace it with?

For example, in a map function, I have (RecordReader<IntWritable,
CustomInput> input, Context context) and in the function body, I have:
long pos = -1;
pos = input.getPos();
while(input.next(key, value)){
//some code here
}

and I get the error: The method getPos() is undefined for the type
RecordReader<IntWritable,CustomInput>

Any pointers or help will be highly appreciated.

Thanks,
Bibek

[0] http://hadoop.apache.org/common/docs/r0.20.1/api/org/apache/hadoop/mapred/RecordReader.html#getPos%28%29
[1] http://www.slideshare.net/sh1mmer/upgrading-to-the-new-map-reduce-api

Mime
View raw message