Revision 52042
Added by Claudio Atzori almost 6 years ago
SimpleRecordParser.java | ||
---|---|---|
20 | 20 |
public class SimpleRecordParser implements RecordParser { |
21 | 21 |
static final Log log = LogFactory.getLog(SimpleRecordParser.class); // NOPMD by marko on 11/24/08 5:02 PM |
22 | 22 |
|
23 |
private long ts; |
|
24 |
|
|
23 | 25 |
@Override |
24 | 26 |
public Map<String, String> parseRecord(String record) { |
25 | 27 |
Map<String, String> props = new HashMap<String, String>(); |
28 |
props.put("timestamp", String.valueOf(getTimestamp())); |
|
26 | 29 |
|
27 | 30 |
try { |
28 | 31 |
// DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); |
... | ... | |
47 | 50 |
|
48 | 51 |
} |
49 | 52 |
|
53 |
@Override |
|
54 |
public void setTimestamp(final long ts) { |
|
55 |
this.ts = ts; |
|
56 |
} |
|
57 |
|
|
58 |
@Override |
|
59 |
public long getTimestamp() { |
|
60 |
return ts; |
|
61 |
} |
|
62 |
|
|
50 | 63 |
} |
Also available in: Unified diff
use the same (hopefully) format for field timestamp, and the same value for each record involved in a transaction