cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject svn commit: r1128457 - in /cassandra/branches/cassandra-0.8.0: CHANGES.txt src/java/org/apache/cassandra/db/ColumnFamily.java src/java/org/apache/cassandra/db/filter/QueryFilter.java
Date Fri, 27 May 2011 21:08:39 GMT
Author: slebresne
Date: Fri May 27 21:08:39 2011
New Revision: 1128457

URL: http://svn.apache.org/viewvc?rev=1128457&view=rev
Log:
Committing fix to CASSANDRA-2675 in that branch
(since it is very problematic with counters)

Modified:
    cassandra/branches/cassandra-0.8.0/CHANGES.txt
    cassandra/branches/cassandra-0.8.0/src/java/org/apache/cassandra/db/ColumnFamily.java
    cassandra/branches/cassandra-0.8.0/src/java/org/apache/cassandra/db/filter/QueryFilter.java

Modified: cassandra/branches/cassandra-0.8.0/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8.0/CHANGES.txt?rev=1128457&r1=1128456&r2=1128457&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8.0/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.8.0/CHANGES.txt Fri May 27 21:08:39 2011
@@ -11,6 +11,7 @@
  * fix exception adding validators to non-string columns (CASSANDRA-2696)
  * avoid instantiating DatabaseDescriptor in JDBC (CASSANDRA-2694)
  * fix potential stack overflow during compaction (CASSANDRA-2626)
+ * clone super columns to avoid modifying them during flush (CASSANDRA-2675)
 
 
 0.8.0-rc1

Modified: cassandra/branches/cassandra-0.8.0/src/java/org/apache/cassandra/db/ColumnFamily.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8.0/src/java/org/apache/cassandra/db/ColumnFamily.java?rev=1128457&r1=1128456&r2=1128457&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8.0/src/java/org/apache/cassandra/db/ColumnFamily.java
(original)
+++ cassandra/branches/cassandra-0.8.0/src/java/org/apache/cassandra/db/ColumnFamily.java
Fri May 27 21:08:39 2011
@@ -142,6 +142,11 @@ public class ColumnFamily implements ICo
         return columns.size();
     }
 
+    public boolean isEmpty()
+    {
+        return columns.isEmpty();
+    }
+
     public boolean isSuper()
     {
         return getType() == ColumnFamilyType.Super;

Modified: cassandra/branches/cassandra-0.8.0/src/java/org/apache/cassandra/db/filter/QueryFilter.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8.0/src/java/org/apache/cassandra/db/filter/QueryFilter.java?rev=1128457&r1=1128456&r2=1128457&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8.0/src/java/org/apache/cassandra/db/filter/QueryFilter.java
(original)
+++ cassandra/branches/cassandra-0.8.0/src/java/org/apache/cassandra/db/filter/QueryFilter.java
Fri May 27 21:08:39 2011
@@ -103,7 +103,19 @@ public class QueryFilter
 
             public void reduce(IColumn current)
             {
-                curCF.addColumn(current);
+                if (curCF.isSuper() && curCF.isEmpty())
+                {
+                    // If it is the first super column we add, we must clone it since other
super column may modify
+                    // it otherwise and it could be aliased in a memtable somewhere. We'll
also don't have to care about what
+                    // consumers make of the result (for instance CFS.getColumnFamily() call
removeDeleted() on the
+                    // result which removes column; which shouldn't be done on the original
super column).
+                    assert current instanceof SuperColumn;
+                    curCF.addColumn(((SuperColumn)current).cloneMe());
+                }
+                else
+                {
+                    curCF.addColumn(current);
+                }
             }
 
             protected IColumn getReduced()



Mime
View raw message