cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [08/10] git commit: remove the index entry on oldColumn when new column is a tombstone patch by jbellis; reviewed by Sam Tunnicliffe for CASSANDRA-5395
Date Fri, 29 Mar 2013 17:07:22 GMT
remove the index entry on oldColumn when new column is a tombstone
patch by jbellis; reviewed by Sam Tunnicliffe for CASSANDRA-5395


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

Branch: refs/heads/trunk
Commit: 8ba462a08b782690119b3090d64ca88a24ba746f
Parents: 8552a84
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Wed Mar 27 14:33:53 2013 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Fri Mar 29 12:05:05 2013 -0500

----------------------------------------------------------------------
 .../cassandra/db/index/SecondaryIndexManager.java  |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8ba462a0/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java b/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
index 0de43b3..4111093 100644
--- a/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
+++ b/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
@@ -609,15 +609,13 @@ public class SecondaryIndexManager
 
         public void update(Column oldColumn, Column column)
         {
-            if (column.isMarkedForDelete())
-                return;
-
             SecondaryIndex index = indexFor(column.name());
             if (index == null)
                 return;
 
             ((PerColumnSecondaryIndex) index).delete(key.key, oldColumn);
-            ((PerColumnSecondaryIndex) index).insert(key.key, column);
+            if (!column.isMarkedForDelete())
+                ((PerColumnSecondaryIndex) index).insert(key.key, column);
         }
 
         public void remove(Column column)
@@ -665,9 +663,6 @@ public class SecondaryIndexManager
 
         public void update(Column oldColumn, Column column)
         {
-            if (column.isMarkedForDelete())
-                return;
-
             SecondaryIndex index = indexFor(column.name());
             if (index == null)
                 return;
@@ -675,7 +670,8 @@ public class SecondaryIndexManager
             if (index instanceof  PerColumnSecondaryIndex)
             {
                 ((PerColumnSecondaryIndex) index).delete(key.key, oldColumn);
-                ((PerColumnSecondaryIndex) index).insert(key.key, column);
+                if (!column.isMarkedForDelete())
+                    ((PerColumnSecondaryIndex) index).insert(key.key, column);
             }
             else
             {


Mime
View raw message