java - Hadoop Mapreduce: Reducer never called -
i have simple map/reduce task. mapper called , executed reducer never called.
configuration:
conf.setjobname("index builder"); conf.setspeculativeexecution(false); fileinputformat.setinputpaths(conf, new path(args[0].tostring())); fileoutputformat.setoutputpath(conf, new path(args[1].tostring())); conf.setinputformat(textinputformat.class); conf.setoutputformat(nulloutputformat.class); conf.setmapperclass(indexmapper.class); conf.setreducerclass(indexreducer.class); conf.setmapoutputkeyclass(nullwritable.class); conf.setmapoutputvalueclass(nullwritable.class); conf.setoutputvalueclass(nullwritable.class); conf.setoutputkeyclass(nullwritable.class);
mapper signature:
public class indexmapper extends mapreducebase implements mapper<longwritable, text, nullwritable, nullwritable> { @override public void map(longwritable key, text val, outputcollector<nullwritable, nullwritable> output, reporter reporter) throws ioexception { // map function } }
ٌreducer signature:
public class indexreducer extends mapreducebase implements reducer<nullwritable, nullwritable, nullwritable, nullwritable> { @override public void reduce(nullwritable arg0, iterator<nullwritable> arg1, outputcollector<nullwritable, nullwritable> arg2, reporter reporter) throws ioexception { // reduce code } }
you set output format nulloutputformat mapper, doesn't produce anything. reducer never called needs data run.
Comments
Post a Comment