Pre defined Mapper class contains below methods, setup() ,run(),cleanup(),map()
Whenever we run the program the framework always call map() method. But some times based on the requirement we may have to use the methods of predefind Mapper class.
So generally we configure the MyMapper and MyReducer classes in driver class. when we run the program The frame work internally creates the mapper object for every block. Then using that object the run() method of predefind Mapper class will be called internally. Because MyMapper is child of Mapper class. This run() method calls the setup() method one time which contains nothing. After this run() method will call map() (this map() is method of MYMapper class) method N number of times. After that run() method will call the cleanup() method one time which contains nothing.
Pre defined Reducer class contains below methods, setup() ,run(),cleanup(),reduce()
MyReducer class is also executed same as MyMapper class.
When you run the program after the MyMapper class execution, MyReducer class will be executed.