October 2018
Beginner
220 pages
5h 33m
English
Any MapReduce job will have your mapper logic, a reducer, and a driver class. We have already gone through Mapper and Reducer in a previous chapter. The driver class is the one that is responsible for running the MapReduce job. Apache Hadoop provides helper classes for its developers to make life easy. In previous examples, we have seen direct calls to MapReduce APIs through job configuration with synchronous and asynchronous calling. The following example shows one such Driver class construct:
public class MapReduceDriver { public static void main(String[] args) throws Exception { Job job = new Job(); job.setMapperClass(MyMapper.class); job.setReducerClass(MyReducer.class); //set other variables job.set.... //run ...Read now
Unlock full access