cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject [2/3] cassandra git commit: Increase size of flushExecutor thread pool size
Date Mon, 04 Jul 2016 12:20:40 GMT
Increase size of flushExecutor thread pool size

Patch by marcuse; reviewed by Branimir Lambov for CASSANDRA-12071


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

Branch: refs/heads/trunk
Commit: 44e475c1a7aa351763fa5bd97664394186565b41
Parents: c86b3e1
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Mon Jul 4 10:49:43 2016 +0200
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Mon Jul 4 14:17:01 2016 +0200

----------------------------------------------------------------------
 CHANGES.txt                                             |  1 +
 src/java/org/apache/cassandra/db/ColumnFamilyStore.java | 10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/44e475c1/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 475365f..b7330f0 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.9
+ * Increase size of flushExecutor thread pool (CASSANDRA-12071)
 Merged from 3.0:
  * Avoid digest mismatch with empty but static rows (CASSANDRA-12090)
  * Fix EOF exception when altering column type (CASSANDRA-11820)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/44e475c1/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index 523e15f..010800b 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -125,7 +125,15 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
 
     private static final Logger logger = LoggerFactory.getLogger(ColumnFamilyStore.class);
 
-    private static final ExecutorService flushExecutor = new JMXEnabledThreadPoolExecutor(1,
+    /*
+    We keep a pool of threads for each data directory, size of each pool is memtable_flush_writers.
+    When flushing we start a Flush runnable in the flushExecutor. Flush calculates how to
split the
+    memtable ranges over the existing data directories and creates a FlushRunnable for each
of the directories.
+    The FlushRunnables are executed in the perDiskflushExecutors and the Flush will block
until all FlushRunnables
+    are finished. By having flushExecutor size the same size as each of the perDiskflushExecutors
we make sure we can
+    have that many flushes going at the same time.
+    */
+    private static final ExecutorService flushExecutor = new JMXEnabledThreadPoolExecutor(DatabaseDescriptor.getFlushWriters(),
                                                                                         
 StageManager.KEEPALIVE,
                                                                                         
 TimeUnit.SECONDS,
                                                                                         
 new LinkedBlockingQueue<Runnable>(),


Mime
View raw message