Temperature.txt 0067011990999991950051507004...9999999N9+00001+99999999999 0043011990999991950051512004...9999999N9+00221+99999999999 0043011990999991950051518004...9999999N9-00111+99999999999 0043012650999991949032412004...0500001N9+01111+99999999999 0043012650999991949032418004...0500001N9+00781+99999999999 MaxTempMapper.java import java.io.IOException; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Mapper; public class MaxTempMapper extends Mapper{ private static final int MISSING = 9999; public void map(LongWritable key , Text value , Context context) throws IOException, InterruptedException { String line = value.toString(); String year = line.substring(15, 19); int airTemp; if(line.charAt(40)== '+') // skip + { airTemp = Integer.parseInt(line.substring(41,45)); } else { airTemp= Integer.parseInt(line.substring(40, 45)); } if(airTemp!=MISSING) { context.write(new Text(year), new IntWritable(airTemp)); } } }