Interpretation WordCount code is divided into three parts: Driver, Mapper, Reducer
1, Driver content (main () method)
2, the content Mapper
. 1, Mapper has three functions, namely, setup, map, Cleanup
after Mapper setup function executed first task starts, the initialization operation for
map function processing logic performs the functions defined for each piece of input keys, and predetermined format of the output of the key
to all key-value after processing, call a cleanup function, the operation for closing the resources
. 3, the content Reducer
1, Reducerr has three functions, namely, setup, reduce, Cleanup
first performed after Reducer task starts the setup function for initialization
reduce function processing logic performs the functions defined for each piece of input keys, and predetermined format of the output of the key
to all key-value after processing, call a cleanup function, the operation for closing the resources