cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [7/8] git commit: add back shouldPurge check before counter merging
Date Thu, 12 Dec 2013 18:47:12 GMT
add back shouldPurge check before counter merging


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

Branch: refs/heads/trunk
Commit: b1711488801781106c90e9143678f94d102e11dd
Parents: 5d25d6d
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Fri Dec 13 00:44:13 2013 +0600
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Fri Dec 13 00:44:13 2013 +0600

----------------------------------------------------------------------
 .../apache/cassandra/db/compaction/LazilyCompactedRow.java   | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b1711488/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java b/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
index 23457bc..bb00d23 100644
--- a/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
+++ b/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
@@ -90,7 +90,7 @@ public class LazilyCompactedRow extends AbstractCompactedRow
         merger = Iterators.filter(MergeIterator.get(rows, emptyColumnFamily.getComparator().onDiskAtomComparator,
reducer), Predicates.notNull());
     }
 
-    private static ColumnFamily removeDeletedAndOldShards(DecoratedKey key, boolean shouldPurge,
CompactionController controller, ColumnFamily cf)
+    private static void removeDeletedAndOldShards(ColumnFamily cf, boolean shouldPurge, DecoratedKey
key, CompactionController controller)
     {
         // We should only purge cell tombstones if shouldPurge is true, but regardless, it's
still ok to remove cells that
         // are shadowed by a row or range tombstone; removeDeletedColumnsOnly(cf, Integer.MIN_VALUE)
will accomplish this
@@ -99,10 +99,8 @@ public class LazilyCompactedRow extends AbstractCompactedRow
         ColumnFamilyStore.removeDeletedColumnsOnly(cf, overriddenGCBefore, controller.cfs.indexManager.updaterFor(key));
 
         // if we have counters, remove old shards
-        if (cf.metadata().getDefaultValidator().isCommutative())
+        if (shouldPurge && cf.metadata().getDefaultValidator().isCommutative())
             CounterColumn.mergeAndRemoveOldShards(key, cf, controller.gcBefore, controller.mergeShardBefore);
-
-        return cf;
     }
 
     public RowIndexEntry write(long currentPosition, DataOutput out) throws IOException
@@ -260,7 +258,7 @@ public class LazilyCompactedRow extends AbstractCompactedRow
                 boolean shouldPurge = container.getSortedColumns().iterator().next().timestamp()
< maxPurgeableTimestamp;
                 // when we clear() the container, it removes the deletion info, so this needs
to be reset each time
                 container.delete(maxRowTombstone);
-                removeDeletedAndOldShards(key, shouldPurge, controller, container);
+                removeDeletedAndOldShards(container, shouldPurge, key, controller);
                 Iterator<Column> iter = container.iterator();
                 if (!iter.hasNext())
                 {


Mime
View raw message