Search

What are the methods in the Reducer class and order of their invocation?

run(Context context)
{
 setup(context);
 while (context.nextKeyValue())
 {
 reduce(context.getCurrentKey(), context.getCurrentValue(), context);
 }
 cleanup(context);
}

setup(Context context)
reduce(Writable key, Writable value, Context context)
cleanup(Context context)



The Reducer class contains the run() method, which call its own setup() method only once, it also call a map() method for each input and finally calls it cleanup() method. We can override all above methods in our code.