cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mshu...@apache.org
Subject [27/50] [abbrv] cassandra git commit: avoid some date math if using raw time formats
Date Tue, 16 Aug 2016 22:42:28 GMT
avoid some date math if using raw time formats


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/d052c904
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/d052c904
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/d052c904

Branch: refs/heads/cassandra-3.8
Commit: d052c90483e44ab8b280c4507d5c11202367dffd
Parents: ca556c4
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Fri Aug 12 19:13:13 2016 -0400
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Fri Aug 12 19:13:13 2016 -0400

----------------------------------------------------------------------
 src/java/org/apache/cassandra/tools/JsonTransformer.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d052c904/src/java/org/apache/cassandra/tools/JsonTransformer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/JsonTransformer.java b/src/java/org/apache/cassandra/tools/JsonTransformer.java
index 3b98595..801197d 100644
--- a/src/java/org/apache/cassandra/tools/JsonTransformer.java
+++ b/src/java/org/apache/cassandra/tools/JsonTransformer.java
@@ -461,9 +461,14 @@ public final class JsonTransformer
 
     private String dateString(TimeUnit from, long time)
     {
+        if (rawTime)
+        {
+            return Long.toString(time);
+        }
+        
         long secs = from.toSeconds(time);
         long offset = Math.floorMod(from.toNanos(time), 1000_000_000L); // nanos per sec
-        return rawTime? Long.toString(time) : Instant.ofEpochSecond(secs, offset).toString();
+        return Instant.ofEpochSecond(secs, offset).toString();
     }
 
     /**


Mime
View raw message