Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Explain what does the conf.setMapper class does in the MapReduce?

Explain what does the conf.setMapper class does in the MapReduce?

New Contributor

Can someone explain what does the conf.setMapper class does in the MapReduce?

2 REPLIES 2

Re: Explain what does the conf.setMapper class does in the MapReduce?

Cloudera Employee

@Harshali Patel

Once a map reduce program is built a driver class has to be created that will be submitted to the cluster. For this we create the object of JobConf class. One of the properties of this object is setMapperClass. conf.setMapperClass() method is used set your mapper class to your driver class. It helps the driver class to get the details like reading data and generating key-Value pairs out of the mapper.

Mapper class is for writing code for mapper function. The map phase is the first primary phase of Hadoop mapreduce programming structure which is responsible for performing operation on the provided input dataset.The Mapper class is a generic type, with four formal parameter types that specify the input key, input value, output key and output value types of the map function.

The driver class which communicates with the Hadoop framework and specifies the configuration elements required to run a MapReduce job. This involves aspects such as telling Hadoop which Mapper and Reducer classes to use, where to find the input data and in what format, and where to place the output data and how to format it.

Please accept my answer if you found helpful.

Highlighted

Re: Explain what does the conf.setMapper class does in the MapReduce?

New Contributor

Once a map reduce program is built a driver class has to be created that will be submitted to the cluster. For this, we create the object of the JobConf class. One of the properties of this object is setMapperClass. Conf.setMapperClass sets the mapper class in the driver. It helps the driver class to get the details like reading data and generating key-Value pairs out of the mapper.

Don't have an account?
Coming from Hortonworks? Activate your account here