cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject git commit: Fix timestamp scaling issue for 6623
Date Thu, 06 Mar 2014 09:26:56 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 ba95ca0db -> 5ef53e6f7


Fix timestamp scaling issue for 6623


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

Branch: refs/heads/cassandra-2.0
Commit: 5ef53e6f7cc64585e93a84311f58fc62b781379d
Parents: ba95ca0
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Thu Mar 6 10:26:20 2014 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Thu Mar 6 10:26:20 2014 +0100

----------------------------------------------------------------------
 .../org/apache/cassandra/cql3/statements/CQL3CasConditions.java  | 3 ++-
 .../apache/cassandra/cql3/statements/ModificationStatement.java  | 4 +---
 2 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5ef53e6f/src/java/org/apache/cassandra/cql3/statements/CQL3CasConditions.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/CQL3CasConditions.java b/src/java/org/apache/cassandra/cql3/statements/CQL3CasConditions.java
index 194ff0c..668f98f 100644
--- a/src/java/org/apache/cassandra/cql3/statements/CQL3CasConditions.java
+++ b/src/java/org/apache/cassandra/cql3/statements/CQL3CasConditions.java
@@ -43,7 +43,8 @@ public class CQL3CasConditions implements CASConditions
     public CQL3CasConditions(CFMetaData cfm, long now)
     {
         this.cfm = cfm;
-        this.now = now;
+        // We will use now for Column.isLive() which expects milliseconds but the argument
is in microseconds.
+        this.now = now / 1000;
         this.conditions = new TreeMap<>(cfm.comparator);
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5ef53e6f/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
index ecefcb9..154c01c 100644
--- a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
@@ -534,9 +534,7 @@ public abstract class ModificationStatement implements CQLStatement, MeasurableF
 
         ByteBuffer key = keys.get(0);
 
-        // It's cleaner to use the query timestamp below, but it's in seconds while the conditions
expects microseconds, so just
-        // put it back in millis (we don't really lose precision because the ultimate consumer,
Column.isLive, re-divide it).
-        CQL3CasConditions conditions = new CQL3CasConditions(cfm, queryState.getTimestamp()
* 1000);
+        CQL3CasConditions conditions = new CQL3CasConditions(cfm, queryState.getTimestamp());
         ColumnNameBuilder prefix = createClusteringPrefixBuilder(variables);
         ColumnFamily updates = UnsortedColumns.factory.create(cfm);
         addUpdatesAndConditions(key, prefix, updates, conditions, variables, getTimestamp(queryState.getTimestamp(),
variables));


Mime
View raw message