@@ -0,0 +1,951 @@
+package com.cloudwick.hadoop.statuscode;%0A%0Aimport java.util.regex.Matcher;%0Aimport java.util.regex.Pattern;%0Aimport java.io.IOException;%0A%0Aimport org.apache.hadoop.io.IntWritable;%0Aimport org.apache.hadoop.io.LongWritable;%0Aimport org.apache.hadoop.io.Text;%0Aimport org.apache.hadoop.mapreduce.Mapper;%0A%0A/*%0A * Created by Darshan S Mahendrakar%0A * Date: 06/05/2015%0A * Email: darshan.sm@cloudwick.com%0A */%0Apublic class StatusCountMapper extends%0A%09%09Mapper%3CLongWritable, Text, Text, IntWritable%3E %7B%0A%0A%09private final static IntWritable one = new IntWritable(1);%0A%09private Text statusCode = new Text();%0A%09Pattern pattern = Pattern.compile(%22(?%3C=%5C%22%5C%5Cs)%5C%5Cd%7B3%7D(?=%5C%5Cs+%5C%5Cd)%22);%0A%09Matcher matcher;%0A%0A%09@Override%0A%09public void map(LongWritable key, Text value, Context context)%0A%09%09%09throws IOException, InterruptedException %7B%0A%09%09String line = value.toString();%0A%09%09matcher = pattern.matcher(line);%0A%09%09matcher.find();%0A%09%09statusCode.set(matcher.group());%0A%09%09context.write(statusCode, one);%0A%09%7D%0A%7D%0A

Create StatusCountMapper.java