Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
How can you set the mappers and reducers for a MapReduce job?
Home
Hadoop
How can you set the mappers and reducers for a MapReduce job?
0
votes
asked
Nov 24, 2020
in
Hadoop
by
rahuljain1
How can you set the mappers and reducers for a MapReduce job?
#reducers
#mapreduce-reducers
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Nov 24, 2020
by
sharadyadav1986
The number of mappers and reducers can be set in the command line using:
-D mapred.map.tasks=5 –D mapred.reduce.tasks=2
In the code, one can configure JobConf variables:
job.setNumMapTasks(5); // 5 mappers
job.setNumReduceTasks(2); // 2 reducers
...