1:编写map类
package org.liufu.hadoop;
import java.io.IOException;
import java.net.InetAddress;
import java.text.SimpleDateFormat;
import java.util.Date;
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 Map extends Mapper<LongWritable, Text, Text, IntWritable> {
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-hh hh:mm:ss");
private Date StartTime = null;
@Override
protected void map(LongWritable keyIn, Text valueIn, Context context)
throws IOException, InterruptedException {
String valueLine = valueIn.toString();
String year = valueLine.substring(5,9)