Repository: cassandra Updated Branches: refs/heads/cassandra-3.9 c86b3e183 -> 44e475c1a refs/heads/trunk f542a2ea6 -> dec1bdb20
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/cassandra-3.9 Commit: 44e475c1a7aa351763fa5bd97664394186565b41 Parents: c86b3e1 Author: Marcus Eriksson <marc...@apache.org> Authored: Mon Jul 4 10:49:43 2016 +0200 Committer: Marcus Eriksson <marc...@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>(),