cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [4/10] git commit: allow dropping columns shadowed by not-yet-expired supercolumn or row tombstones in PrecompactedRow patch by jbellis; reviewed by slebresne for CASSANDRA-4396
Date Mon, 02 Jul 2012 08:14:10 GMT
allow dropping columns shadowed by not-yet-expired supercolumn or row tombstones in PrecompactedRow
patch by jbellis; reviewed by slebresne for CASSANDRA-4396


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

Branch: refs/heads/trunk
Commit: 5bcfcbc3ed1bbaadcd0f6e373d0d207db38ec6c2
Parents: 5aad64a
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Mon Jul 2 02:56:03 2012 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Mon Jul 2 03:00:06 2012 -0500

----------------------------------------------------------------------
 CHANGES.txt                                        |    2 ++
 .../cassandra/db/AbstractColumnContainer.java      |    4 ++--
 src/java/org/apache/cassandra/db/Column.java       |    2 +-
 src/java/org/apache/cassandra/db/IColumn.java      |    2 +-
 .../org/apache/cassandra/db/IColumnContainer.java  |    2 +-
 .../cassandra/db/compaction/PrecompactedRow.java   |    2 +-
 6 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5bcfcbc3/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 1fe21aa..c752244 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 1.0.11
+ * allow dropping columns shadowed by not-yet-expired supercolumn or row
+   tombstones in PrecompactedRow (CASSANDRA-4396)
  * synchronize LCS getEstimatedTasks to avoid CME (CASSANDRA-4255)
  * ensure unique streaming session id's (CASSANDRA-4223)
  * kick off background compaction when min/max thresholds change 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5bcfcbc3/src/java/org/apache/cassandra/db/AbstractColumnContainer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/AbstractColumnContainer.java b/src/java/org/apache/cassandra/db/AbstractColumnContainer.java
index 87e75eb..af8a010 100644
--- a/src/java/org/apache/cassandra/db/AbstractColumnContainer.java
+++ b/src/java/org/apache/cassandra/db/AbstractColumnContainer.java
@@ -251,13 +251,13 @@ public abstract class AbstractColumnContainer implements IColumnContainer,
IIter
         }
     }
 
-    public boolean hasExpiredTombstones(int gcBefore)
+    public boolean hasIrrelevantData(int gcBefore)
     {
         if (isMarkedForDelete() && getLocalDeletionTime() < gcBefore)
             return true;
 
         for (IColumn column : columns)
-            if (column.hasExpiredTombstones(gcBefore))
+            if (column.mostRecentLiveChangeAt() < getLocalDeletionTime() || column.hasIrrelevantData(gcBefore))
                 return true;
 
         return false;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5bcfcbc3/src/java/org/apache/cassandra/db/Column.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/Column.java b/src/java/org/apache/cassandra/db/Column.java
index a7cd39f..072bfde 100644
--- a/src/java/org/apache/cassandra/db/Column.java
+++ b/src/java/org/apache/cassandra/db/Column.java
@@ -281,7 +281,7 @@ public class Column implements IColumn
             valueValidator.validate(value());
     }
 
-    public boolean hasExpiredTombstones(int gcBefore)
+    public boolean hasIrrelevantData(int gcBefore)
     {
         return isMarkedForDelete() && getLocalDeletionTime() < gcBefore;
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5bcfcbc3/src/java/org/apache/cassandra/db/IColumn.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/IColumn.java b/src/java/org/apache/cassandra/db/IColumn.java
index fe6e949..cefc12c 100644
--- a/src/java/org/apache/cassandra/db/IColumn.java
+++ b/src/java/org/apache/cassandra/db/IColumn.java
@@ -75,7 +75,7 @@ public interface IColumn
     /**
      * @return true if the column or any its subcolumns expired before @param gcBefore
      */
-    public boolean hasExpiredTombstones(int gcBefore);
+    public boolean hasIrrelevantData(int gcBefore);
 
     /**
      * For a standard column, this is the same as timestamp().

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5bcfcbc3/src/java/org/apache/cassandra/db/IColumnContainer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/IColumnContainer.java b/src/java/org/apache/cassandra/db/IColumnContainer.java
index b300706..3259fdd 100644
--- a/src/java/org/apache/cassandra/db/IColumnContainer.java
+++ b/src/java/org/apache/cassandra/db/IColumnContainer.java
@@ -44,7 +44,7 @@ public interface IColumnContainer
 
     public boolean isMarkedForDelete();
     public long getMarkedForDeleteAt();
-    public boolean hasExpiredTombstones(int gcBefore);
+    public boolean hasIrrelevantData(int gcBefore);
 
     public AbstractType getComparator();
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5bcfcbc3/src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java b/src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java
index 5b5ba8d..aced6d9 100644
--- a/src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java
+++ b/src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java
@@ -67,7 +67,7 @@ public class PrecompactedRow extends AbstractCompactedRow
         // taking this into account.
         Boolean shouldPurge = null;
 
-        if (cf.hasExpiredTombstones(controller.gcBefore))
+        if (cf.hasIrrelevantData(controller.gcBefore))
             shouldPurge = controller.shouldPurge(key);
         ColumnFamily compacted = shouldPurge != null && shouldPurge
                                ? ColumnFamilyStore.removeDeleted(cf, controller.gcBefore)


Mime
View raw message