Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Mapper of Reducer setup() used for?

Tags:

java

mapreduce

What exactly are the setup and cleanup methods used for? I have tried to find out what they mean, but no one had yet to describe exactly what they do. For instance, how does the setup method use the data from the input split? does it take it as a whole? or line by line?

like image 262
Don E Avatar asked Aug 21 '14 17:08

Don E


People also ask

What does mapper and reducer do?

All inputs and outputs are stored in the HDFS. While the map is a mandatory step to filter and sort the initial data, the reduce function is optional. Mappers and Reducers are the Hadoop servers that run the Map and Reduce functions respectively. It doesn't matter if these are the same or different servers.

What is the use of mapper in Hadoop?

Hadoop Mapper is a function or task which is used to process all input records from a file and generate the output which works as input for Reducer. It produces the output by returning new key-value pairs.

What is the use of mapper and reducer in Hadoop?

The mapper processes the data and creates several small chunks of data. Reduce stage − This stage is the combination of the Shuffle stage and the Reduce stage. The Reducer's job is to process the data that comes from the mapper. After processing, it produces a new set of output, which will be stored in the HDFS.

What is the purpose of the setup cleanup methods in a Hadoop job?

What is the purpose of the setup/cleanup methods in a Hadoop job? To enable combiners to initialize a global resource.


1 Answers

setup: Called once at the beginning of the task.

You can put custom initialization here.

cleanup: Called once at the end of the task.

You can put resource releasing here.

like image 110
pasha701 Avatar answered Nov 15 '22 18:11

pasha701