You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-user@hadoop.apache.org by Markus Pilman <ma...@pilman.ch> on 2010/11/09 12:08:18 UTC

Question regarding the location in a map reduce function

Hi all,

I am very new to Hadoop and I have a (it seems to me it should be quite simple) question regarding MapReduce:

I wanted to implement a simple Map Reduce to create an inverted index over a list of files on my DFS. The code is quite easy, but I cannot figure out, how I get to the exact location of the string I get the location of the text I am analyzing in a map run. So my map function has the following signature:

		public void map(Object key, Text value, Context context)
				throws IOException, InterruptedException {
				// my code would go here 
		}

I figured out, that the key is a long - but I could not figure out, what this long is. In particular I need to know: 
- on which file am I working
- which line and column

How would I need to do that?

Any help/hint would be very appreciated!

Thanks Markus