1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.hadoop.chukwa.extraction.demux;
20
21
22 import org.apache.hadoop.chukwa.extraction.demux.processor.Util;
23 import org.apache.hadoop.chukwa.extraction.engine.ChukwaRecord;
24 import org.apache.hadoop.chukwa.extraction.engine.ChukwaRecordKey;
25 import org.apache.hadoop.chukwa.extraction.engine.RecordUtil;
26 import org.apache.hadoop.mapred.lib.MultipleSequenceFileOutputFormat;
27 import org.apache.log4j.Logger;
28
29 public class ChukwaRecordOutputFormat extends
30 MultipleSequenceFileOutputFormat<ChukwaRecordKey, ChukwaRecord> {
31 static Logger log = Logger.getLogger(ChukwaRecordOutputFormat.class);
32
33 @Override
34 protected String generateFileNameForKeyValue(ChukwaRecordKey key,
35 ChukwaRecord record, String name) {
36 String output = RecordUtil.getClusterName(record) + "/"
37 + key.getReduceType() + "/" + key.getReduceType()
38 + Util.generateTimeOutput(record.getTime());
39
40
41
42 return output;
43 }
44 }