Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EC7C3200C5E for ; Fri, 7 Apr 2017 12:33:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EB1F5160B93; Fri, 7 Apr 2017 10:33:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3EF51160B97 for ; Fri, 7 Apr 2017 12:33:45 +0200 (CEST) Received: (qmail 1983 invoked by uid 500); 7 Apr 2017 10:33:44 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 1939 invoked by uid 99); 7 Apr 2017 10:33:44 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Apr 2017 10:33:44 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 12438E0F98; Fri, 7 Apr 2017 10:33:44 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ifesdjeen@apache.org To: commits@cassandra.apache.org Date: Fri, 07 Apr 2017 10:33:45 -0000 Message-Id: <558ac2eb0b734ba8b0e4111d66a64160@git.apache.org> In-Reply-To: <2eb09a33cde8448e9b53e7fb0b59e95c@git.apache.org> References: <2eb09a33cde8448e9b53e7fb0b59e95c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/3] cassandra git commit: Use equal to maxPoolSize in JMXEnabledThreadPoolExecutors archived-at: Fri, 07 Apr 2017 10:33:46 -0000 Use equal to maxPoolSize in JMXEnabledThreadPoolExecutors Patch by Aleksandr Sorokoumov; reviewed by Alex Petrov for CASSANDRA-13329. Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/8eeea07f Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/8eeea07f Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/8eeea07f Branch: refs/heads/trunk Commit: 8eeea07f5f74eb86403e84464107b75c5063cf6b Parents: 863ad11 Author: Aleksandr Sorokoumov Authored: Wed Mar 22 21:28:36 2017 +0100 Committer: Alex Petrov Committed: Fri Apr 7 12:32:06 2017 +0200 ---------------------------------------------------------------------- CHANGES.txt | 1 + src/java/org/apache/cassandra/hints/HintsDispatchExecutor.java | 5 +---- .../apache/cassandra/index/sasi/disk/PerSSTableIndexWriter.java | 5 +++-- 3 files changed, 5 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/8eeea07f/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index aa8c3ff..ce7c5cf 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 3.11.0 + * Use corePoolSize equal to maxPoolSize in JMXEnabledThreadPoolExecutors (CASSANDRA-13329) * Avoid rebuilding SASI indexes containing no values (CASSANDRA-12962) * Add charset to Analyser input stream (CASSANDRA-13151) * Fix testLimitSSTables flake caused by concurrent flush (CASSANDRA-12820) http://git-wip-us.apache.org/repos/asf/cassandra/blob/8eeea07f/src/java/org/apache/cassandra/hints/HintsDispatchExecutor.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/hints/HintsDispatchExecutor.java b/src/java/org/apache/cassandra/hints/HintsDispatchExecutor.java index 54cddd9..a28ca5a 100644 --- a/src/java/org/apache/cassandra/hints/HintsDispatchExecutor.java +++ b/src/java/org/apache/cassandra/hints/HintsDispatchExecutor.java @@ -60,10 +60,7 @@ final class HintsDispatchExecutor this.isAlive = isAlive; scheduledDispatches = new ConcurrentHashMap<>(); - executor = new JMXEnabledThreadPoolExecutor(1, - maxThreads, - 1, - TimeUnit.MINUTES, + executor = new JMXEnabledThreadPoolExecutor(maxThreads, maxThreads,1, TimeUnit.MINUTES, new LinkedBlockingQueue<>(), new NamedThreadFactory("HintsDispatcher", Thread.MIN_PRIORITY), "internal"); http://git-wip-us.apache.org/repos/asf/cassandra/blob/8eeea07f/src/java/org/apache/cassandra/index/sasi/disk/PerSSTableIndexWriter.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/index/sasi/disk/PerSSTableIndexWriter.java b/src/java/org/apache/cassandra/index/sasi/disk/PerSSTableIndexWriter.java index 708dd9d..d5ecaf7 100644 --- a/src/java/org/apache/cassandra/index/sasi/disk/PerSSTableIndexWriter.java +++ b/src/java/org/apache/cassandra/index/sasi/disk/PerSSTableIndexWriter.java @@ -55,18 +55,19 @@ public class PerSSTableIndexWriter implements SSTableFlushObserver { private static final Logger logger = LoggerFactory.getLogger(PerSSTableIndexWriter.class); + private static final int POOL_SIZE = 8; private static final ThreadPoolExecutor INDEX_FLUSHER_MEMTABLE; private static final ThreadPoolExecutor INDEX_FLUSHER_GENERAL; static { - INDEX_FLUSHER_GENERAL = new JMXEnabledThreadPoolExecutor(1, 8, 60, TimeUnit.SECONDS, + INDEX_FLUSHER_GENERAL = new JMXEnabledThreadPoolExecutor(POOL_SIZE, POOL_SIZE, 1, TimeUnit.MINUTES, new LinkedBlockingQueue<>(), new NamedThreadFactory("SASI-General"), "internal"); INDEX_FLUSHER_GENERAL.allowCoreThreadTimeOut(true); - INDEX_FLUSHER_MEMTABLE = new JMXEnabledThreadPoolExecutor(1, 8, 60, TimeUnit.SECONDS, + INDEX_FLUSHER_MEMTABLE = new JMXEnabledThreadPoolExecutor(POOL_SIZE, POOL_SIZE, 1, TimeUnit.MINUTES, new LinkedBlockingQueue<>(), new NamedThreadFactory("SASI-Memtable"), "internal");