The main task of Reducer is to reduce a larger set of data that shares a key to a smaller set of data. In Hadoop, Reducer has following three core methods:
1. setup(): At the start of a task, setup() method is called to configure various parameters for Reducer.
2. reduce(): This is the main
operation of Reducer. In reduce() method we define the task that has to be done for a set of values that share a key.
3. cleanup(): Once reduce() task is done, we can use cleanup() to clean any intermediate data or temporary files.