Now let us load this data using a MapReduce process from the same file, contacts.log. A very simple MapReduce program can be used for doing this, which is shown in the following code snippet. The source code for all the code in this chapter can be found in chapter09 folder on GitHub repository which we have cloned earlier. The following code block can be found in chapter09/contacts-loader-mr project:
import org.apache.hadoop.conf.Configuration;import org.apache.hadoop.fs.Path;import org.apache.hadoop.io.LongWritable;import org.apache.hadoop.io.Text;import org.apache.hadoop.mapreduce.Job;import org.apache.hadoop.mapreduce.Mapper;import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; ...