@@ -0,0 +1,2666 @@
+package org.hackreduce.examples;%0A%0Aimport org.apache.hadoop.conf.Configuration;%0Aimport org.apache.hadoop.conf.Configured;%0Aimport org.apache.hadoop.filecache.DistributedCache;%0Aimport org.apache.hadoop.fs.FileSystem;%0Aimport org.apache.hadoop.fs.Path;%0Aimport org.apache.hadoop.io.LongWritable;%0Aimport org.apache.hadoop.io.Text;%0Aimport org.apache.hadoop.mapreduce.Job;%0Aimport org.apache.hadoop.mapreduce.Reducer;%0Aimport org.apache.hadoop.mapreduce.lib.input.FileInputFormat;%0Aimport org.apache.hadoop.mapreduce.lib.input.TextInputFormat;%0Aimport org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;%0Aimport org.apache.hadoop.util.Tool;%0Aimport org.apache.hadoop.util.ToolRunner;%0Aimport org.hackreduce.mappers.ModelMapper;%0A%0Aimport java.io.IOException;%0A%0A%0A/**%0A * This MapReduce job to process%0A *%0A */%0Apublic class LoceratureStageOneJob extends Configured implements Tool %7B%0A%0A%09public enum RecordCounterCount %7B%0A%09%09UNIQUE_KEYS%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) throws Exception %7B%0A%09%09int result = ToolRunner.run(new Configuration(), new LoceratureStageOneJob(), args);%0A%09%09System.exit(result);%0A%09%7D%0A%0A%09@Override%0A%09public int run(String%5B%5D args) throws Exception %7B%0A%09%09Configuration conf = getConf();%0A%0A        if (args.length != 0) %7B%0A        %09System.err.println(%22Not sure what you think you're passing.%22);%0A        %09System.exit(2);%0A        %7D%0A%0A        // Creating the MapReduce job (configuration) object%0A        Job job = new Job(conf);%0A        job.setJarByClass(getClass());%0A        job.setJobName(getClass().getName());%0A%0A        // Tell the job which Mapper and Reducer to use (classes defined above)%0A        //job.setMapperClass();      // Will be python script%0A%09%09job.setReducerClass(LargestPopulationReduce.class);%0A%0A        job.setInputFormatClass(TextInputFormat.class);%0A%0A%09%09// This is what the Mapper will be outputting to the Reducer%0A%09%09job.setMapOutputKeyClass(Text.class);%0A%09%09job.setMapOutputValueClass(Text.class);    // Streaming can only output Text%0A%0A%09%09// This is what the Reducer will be outputting%0A%09%09job.setOutputKeyClass(Text.class);%0A%09%09job.setOutputValueClass(Text.class);           // Since The distributedCache is being saved to a file%0A%0A%09%09// Setting the input folder of the job %0A%09%09FileInputFormat.addInputPath(job, new Path(args%5B0%5D));        // Hardcoding sucks if someone is trying to test%0A%0A%09%09// Preparing the output folder by first deleting it if it exists%0A        Path output = new Path(%22/tmp/locerature_stage1%22);%0A        FileSystem.get(conf).delete(output, true);%0A%09    FileOutputFormat.setOutputPath(job, output);%0A%0A        new DistributedCache.addCacheFile(%22/datasets/geonames/cities15000/cities15000.txt%22, job);%0A%0A%09%09return job.waitForCompletion(true) ? 0 : 1;%0A%09%7D%0A%7D%0A

Add job config