cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [2/3] git commit: omit zero counts from compaction merge summary
Date Sat, 02 Nov 2013 00:41:09 GMT
omit zero counts from compaction merge summary


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

Branch: refs/heads/trunk
Commit: 579eb229519e5e3b276f918b89158a242c2dec34
Parents: 91fa467
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Fri Nov 1 19:40:56 2013 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Fri Nov 1 19:40:56 2013 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/compaction/CompactionTask.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/579eb229/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionTask.java b/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
index 0b2cb54..cd7d3d9 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
@@ -261,8 +261,11 @@ public class CompactionTask extends AbstractCompactionTask
         Map<Integer, Long> mergedRows = new HashMap<Integer, Long>();
         for (int i = 0; i < counts.length; i++)
         {
-            int rows = i + 1;
             long count = counts[i];
+            if (count == 0)
+                continue;
+
+            int rows = i + 1;
             totalSourceRows += rows * count;
             mergeSummary.append(String.format("%d:%d, ", rows, count));
             mergedRows.put(rows, count);


Mime
View raw message