From the course: Learning Hadoop
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Review MapReduce WordCount job code - Hadoop Tutorial
From the course: Learning Hadoop
Review MapReduce WordCount job code
- [Instructor] Next we're going to examine an example in Java for MapReduce for word count. And I'm going to call out the code components and then show you example code broken in parts and then altogether. So this is the code that we ran in the previous movie. So the components to look for are the writeable/write comparable Input and output data, the Mapper, the Reducer, the Partitioner, the Reporter, and the OutputCollector. So in this MapReduce Mapper Code, I have bolded some of these key aspects. You can see on the public static Map class is extending the base and it implements a Mapper with a LongWriteable, Text, Text and IntWriteable, so that you have a counter, and then you have a private final static IntWriteable, which is one that's your, you know, each word, private Text word new Text, and then the map method itself uses a LongWriteable as a key and Text as a value, and then it produces an OutputCollector with a…