Ejemplo n.º 1
0
 @Override
 public void map(LongWritable key, Text value, Context context)
     throws IOException, InterruptedException {
   try {
     CSVParser parser = new CSVParser();
     String[] fields = parser.parseLine(value.toString());
     BrowerLog BrowerLog = new BrowerLog(fields.length);
     BrowerLog.setFileds(fields);
     newValue.set(BrowerLog.toString());
     context.write(NullWritable.get(), newValue);
   } catch (Exception e) {
     //				newValue.set(e.getMessage() + "\t" + value.toString());
     //				multipleOutputs.write(NullWritable.get(), newValue, errorOutputDir);
   }
 }
Ejemplo n.º 2
0
 public void reduce(NullWritable Key, Iterable<Text> values, Context context)
     throws IOException, InterruptedException {
   for (Text val : values) context.write(NullWritable.get(), val);
 }