Hi, I would say the approach you have suggested violates the idea of an OutputFormat. The OutputFormat will simply define how the <key,value> pairs are written to disk. To achieve what you want I feel like it should be a separate MapReduce phase that comes after your original one.
Thank you, Saliya On Mon, Apr 19, 2010 at 7:45 AM, Utku Can Topçu <u...@topcu.gen.tr> wrote: > Hello All, > > I've been looking for the documentation and the API docs, > however I couldn't find an OutPutFormat that will go through all the reduce > emits as key:value pairs by running an execute method for each pair. > > Say, I've reduced hostnames as keys, and want to ping every hostname that > I've reduced as key and store the results of pings in a MySQL table or so. > > So basically, > What I'm thinking of was such a method like: > > outputExec(K key, V value){ > ... > pingResult = ping(key) > writetoMysql(value,pingResult) > .... > } > > Is there such an OutPutFormat implementation currently in Hadoop? If not > so, I'd like to start doing something that fits my needs and try to > contribute in to the project, but I think I'll need some guidance beforehand > dealing with the OutPutFormat. > > Best Regards, > Utku > > > > > -- Saliya Ekanayake http://www.esaliya.blogspot.com http://www.esaliya.wordpress.com