setup and cleanup methods of Mapper/Reducer in Hadoop MapReduce

前端 未结 5 1749
一生所求
一生所求 2020-12-24 03:10

Are setup and cleanup methods called in each mapper and reducer tasks respectively? Or are they called only once at the start of overall mapper and reducer jobs?

5条回答
  •  隐瞒了意图╮
    2020-12-24 03:23

    One clarification is helpful. The setup/cleanup methods are used for initialization and clean up at task level. Within a task, first initialization happens with a single call to setup() method and then all calls to map() [or reduce()] function will be done. After that another single call will be made to cleanup() method before exiting the task.

提交回复
热议问题