cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasobr...@apache.org
Subject [03/11] git commit: Fix IllegalArgumentException during statement preparation
Date Fri, 31 Jan 2014 14:12:46 GMT
Fix IllegalArgumentException during statement preparation

patch by slebresne; reviewed by thobbs for CASSANDRA-6592


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

Branch: refs/heads/trunk
Commit: a8a12d9e0adee65bad19dcfd86e7b0cf6b1ed89a
Parents: e7b23cc
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Fri Jan 31 10:09:32 2014 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Fri Jan 31 10:09:32 2014 +0100

----------------------------------------------------------------------
 CHANGES.txt                                              |  1 +
 .../apache/cassandra/cql3/statements/BatchStatement.java |  5 ++++-
 .../cassandra/cql3/statements/ModificationStatement.java |  6 +++++-
 .../cassandra/cql3/statements/SelectStatement.java       | 11 ++++++++++-
 4 files changed, 20 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a8a12d9e/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 94b21d4..a29f212 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -18,6 +18,7 @@
  * SSTableScanner may skip rows during cleanup (CASSANDRA-6638)
  * sstables from stalled repair sessions can resurrect deleted data (CASSANDRA-6503)
  * Switch stress to use ITransportFactory (CASSANDRA-6641)
+ * Fix IllegalArgumentException during prepare (CASSANDRA-6592)
 Merged from 1.2:
  * fsync compression metadata (CASSANDRA-6531)
  * Validate CF existence on execution for prepared statement (CASSANDRA-6535)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a8a12d9e/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
index 25f61fb..6151490 100644
--- a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
@@ -66,7 +66,10 @@ public class BatchStatement implements CQLStatement, MeasurableForPreparedCache
 
     public long measureForPreparedCache(MemoryMeter meter)
     {
-        long size = meter.measure(this) + meter.measure(statements) + meter.measureDeep(attrs);
+        long size = meter.measure(this)
+                  + meter.measureDeep(type)
+                  + meter.measure(statements)
+                  + meter.measureDeep(attrs);
         for (ModificationStatement stmt : statements)
             size += stmt.measureForPreparedCache(meter);
         return size;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a8a12d9e/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 9e0fd62..c0bf428 100644
--- a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
@@ -66,7 +66,11 @@ public abstract class ModificationStatement implements CQLStatement, MeasurableF
 
     public long measureForPreparedCache(MemoryMeter meter)
     {
-        return meter.measureDeep(this) - meter.measureDeep(cfm);
+        return meter.measure(this)
+             + meter.measureDeep(attrs)
+             + meter.measureDeep(processedKeys)
+             + meter.measureDeep(columnOperations)
+             + (columnConditions == null ? 0 : meter.measureDeep(columnConditions));
     }
 
     public abstract boolean requireFullClusteringKey();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a8a12d9e/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index c3671be..29cafa2 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -112,7 +112,16 @@ public class SelectStatement implements CQLStatement, MeasurableForPreparedCache
 
     public long measureForPreparedCache(MemoryMeter meter)
     {
-        return meter.measureDeep(this) - meter.measureDeep(cfDef);
+        return meter.measure(this)
+             + meter.measureDeep(parameters)
+             + meter.measureDeep(selection)
+             + (limit == null ? 0 : meter.measureDeep(limit))
+             + meter.measureDeep(keyRestrictions)
+             + meter.measureDeep(columnRestrictions)
+             + meter.measureDeep(metadataRestrictions)
+             + meter.measureDeep(restrictedNames)
+             + (sliceRestriction == null ? 0 : meter.measureDeep(sliceRestriction))
+             + (orderingIndexes == null ? 0 : meter.measureDeep(orderingIndexes));
     }
 
     public int getBoundTerms()


Mime
View raw message