I'd like to write a combiner that shares a lot of code with a reducer,
except that the reducer updates an external database at the end. As far as I
can tell, since both combiners and reducers must implement the Reducer
interface, there is no way to have this be the same class. Is there a
recommended way to test inside the task whether you're running as a combiner
(in a map task) or as a reducer?
If not, I think this might be an interesting thing to support in the Hadoop
1.0 API. It would enable people to write an AbstractJob class where you just
implement map, combine and reduce functions, and can thus write MapReduce
jobs in a single Java class. Having separate mapper and reducer classes
would still be supported of course.

Reply via email to