@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); } }
public void reduce(NullWritable Key, Iterable<Text> values, Context context) throws IOException, InterruptedException { for (Text val : values) context.write(NullWritable.get(), val); }