Home > Software > BIGDATA > HADOOP
Interview Questions   Tutorials   Discussions   Programs   Videos   Discussion   

HADOOP - Where do you specify the Mapper Implementation?




662
views
asked SRVMTrainings July 10, 2013 01:02 AM  

Where do you specify the Mapper Implementation?


           

2 Answers



 
answered By   0  
from revised API:Instead of using JobConf,OutputCollerctor,Reporter we can use Context which unifies these 3
flag   
   add comment

 
answered By   0  



You set the mapper implemetation in job configuration like below.

 JobConf conf = new JobConf(Test.class);
  conf.setMapperClass(Map.class);

Suppose you have class Test and you have overidden Mapper class as below..

public class Test {

  public static void main(String[] args) throws IOException {
    JobConf conf = new JobConf(Test.class);
    conf.setMapperClass(Map.class);

   }
  public static class Map extends MapReduceBase implements Mapper<LongWritable, Text, Text, Text> {
        public void map(LongWritable key, Text value, OutputCollector<Text, Text> output, Reporter  
    reporter)    throws IOException {

    }
   }


flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert