MapReduce数据处理
数据格式如下: 清洗数据,提取下列信息做精细化操作, ip--->城市 city(IP) date--> time:2016-11-10 00:01:03(日期) day: 10(天数) traffic:62(流量) type:article/video(类型:视频 video或文章 article) id:11325(视频或者文章的 id) 1 public static class Map extends Mapper<Object, Text, IntWritable, Text> { 2 private static Text goods = new Text(); 3 private static IntWritable num = new IntWritable(); 4 5 public void map(Object key, Text value, Context context) throws IOException, InterruptedException { 6 String line = value.toString(); 7 String arr[] = line.split("[ \t/:]"); 8 num.set(Integer.parseInt(arr[0])); 9 goods.set(arr[1] + "\t" + arr[4] + "