cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject cassandra git commit: LCS estimated compaction tasks does not take number of files into account
Date Fri, 07 Apr 2017 10:56:48 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk a0a0e823e -> 39bf436fa


LCS estimated compaction tasks does not take number of files into account

patch by Jan Karlsson; reviewed by marcuse for CASSANDRA-13354


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

Branch: refs/heads/trunk
Commit: 39bf436faa3e17de6f1bcf8e47ab7fa80fe5c0c8
Parents: a0a0e82
Author: Jan Karlsson <jan.karlsson@ericsson.com>
Authored: Mon Mar 20 16:37:43 2017 +0100
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Fri Apr 7 12:56:10 2017 +0200

----------------------------------------------------------------------
 CHANGES.txt                                                   | 1 +
 .../org/apache/cassandra/db/compaction/LeveledManifest.java   | 7 +++++++
 2 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/39bf436f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index f74914c..7797903 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.0
+ * Take number of files in L0 in account when estimating remaining compaction tasks (CASSANDRA-13354)
  * Skip building views during base table streams on range movements (CASSANDRA-13065)
  * Improve error messages for +/- operations on maps and tuples (CASSANDRA-13197)
  * Remove deprecated repair JMX APIs (CASSANDRA-11530)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/39bf436f/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java b/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
index 0c53812..9b735de 100644
--- a/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
+++ b/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
@@ -793,6 +793,13 @@ public class LeveledManifest
             tasks += estimated[i];
         }
 
+        if (!DatabaseDescriptor.getDisableSTCSInL0() && getLevel(0).size() > MAX_COMPACTING_L0)
+        {
+            int l0compactions = getLevel(0).size() / MAX_COMPACTING_L0;
+            tasks += l0compactions;
+            estimated[0] += l0compactions;
+        }
+
         logger.trace("Estimating {} compactions to do for {}.{}",
                      Arrays.toString(estimated), cfs.keyspace.getName(), cfs.name);
         return Ints.checkedCast(tasks);


Mime
View raw message