cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1140935 - in /cassandra/trunk: CHANGES.txt src/java/org/apache/cassandra/db/ColumnFamilyStore.java src/java/org/apache/cassandra/db/Memtable.java
Date Wed, 29 Jun 2011 01:26:03 GMT
Author: jbellis
Date: Wed Jun 29 01:26:02 2011
New Revision: 1140935

URL: http://svn.apache.org/viewvc?rev=1140935&view=rev
Log:
don't bother persisting columns shadowed by a row tombstone
patch by Aaron Morton; reviewed by jbellis for CASSANDRA-2589

Modified:
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
    cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java

Modified: cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/CHANGES.txt?rev=1140935&r1=1140934&r2=1140935&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Wed Jun 29 01:26:02 2011
@@ -5,9 +5,11 @@
  * make AbstractBounds.normalize de-overlapp overlapping ranges (CASSANDRA-2641)
  * replace CollatingIterator, ReducingIterator with MergeIterator 
    (CASSANDRA-2062)
- * Fixed the ability to set compaction strategy in cli using create column family command
(CASSANDRA-2778)
+ * Fixed the ability to set compaction strategy in cli using create column 
+   family command (CASSANDRA-2778)
  * clean up tmp files after failed compaction (CASSANDRA-2468)
  * restrict repair streaming to specific columnfamilies (CASSANDRA-2280)
+ * don't bother persisting columns shadowed by a row tombstone (CASSANDRA-2589)
 
 
 0.8.2

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=1140935&r1=1140934&r2=1140935&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java Wed Jun 29 01:26:02
2011
@@ -795,7 +795,7 @@ public class ColumnFamilyStore implement
         return removeDeletedCF(cf, gcBefore);
     }
 
-    private static void removeDeletedColumnsOnly(ColumnFamily cf, int gcBefore)
+    public static void removeDeletedColumnsOnly(ColumnFamily cf, int gcBefore)
     {
         if (cf.isSuper())
             removeDeletedSuper(cf, gcBefore);

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java?rev=1140935&r1=1140934&r2=1140935&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java Wed Jun 29 01:26:02 2011
@@ -232,7 +232,15 @@ public class Memtable
             // (we can't clear out the map as-we-go to free up memory,
             //  since the memtable is being used for queries in the "pending flush" category)
             for (Map.Entry<DecoratedKey, ColumnFamily> entry : columnFamilies.entrySet())
-                writer.append(entry.getKey(), entry.getValue());
+            {
+                ColumnFamily cf = entry.getValue();
+                if (cf.isMarkedForDelete())
+                {
+                    // don't bother persisting data shadowed by a row tombstone
+                    ColumnFamilyStore.removeDeletedColumnsOnly(cf, Integer.MIN_VALUE);
+                }
+                writer.append(entry.getKey(), cf);
+            }
 
             ssTable = writer.closeAndOpenReader();
         }



Mime
View raw message