Permalink
Browse files

Preserve timestamp from when the event was generated if it exists.

  • Loading branch information...
1 parent 8655add commit 607f809d500765a3687a599cc1f9fbd0347f217c @roycamp roycamp committed Dec 21, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/java/org/apache/cassandra/plugins/SimpleCassandraSink.java
View
5 src/java/org/apache/cassandra/plugins/SimpleCassandraSink.java
@@ -63,7 +63,10 @@ public void open() throws IOException {
@Override
public void append(Event event) throws IOException, InterruptedException {
- long timestamp = System.currentTimeMillis() * MILLI_TO_MICRO;
+ // Preserve timestamp from when the event was generated
+ long timestamp = event.getTimestamp();
+ if(timestamp == 0)
+ timestamp = System.currentTimeMillis() * MILLI_TO_MICRO;
// Make the index column
UUID uuid = uuidGen.generateTimeBasedUUID();

0 comments on commit 607f809

Please sign in to comment.