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: add threadpool size adjustment methods to JMXEnabledThreadPoolExecutor and CompactionManagerMBean patch by Carl Yeksigian; reviewed by jbellis for CASSANDRA-5044
Date Fri, 28 Dec 2012 17:09:20 GMT
add threadpool size adjustment methods to JMXEnabledThreadPoolExecutor and CompactionManagerMBean
patch by Carl Yeksigian; reviewed by jbellis for CASSANDRA-5044


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

Branch: refs/heads/trunk
Commit: 8219195d0af457a5343c989496fca2edc4f53ff7
Parents: 1d96e32
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Fri Dec 28 12:09:11 2012 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Fri Dec 28 12:09:11 2012 -0500

----------------------------------------------------------------------
 CHANGES.txt                                        |    2 +
 .../concurrent/JMXEnabledThreadPoolExecutor.java   |   20 +++++++
 .../JMXEnabledThreadPoolExecutorMBean.java         |   20 +++++++
 .../cassandra/db/compaction/CompactionManager.java |   40 +++++++++++++
 .../db/compaction/CompactionManagerMBean.java      |   44 +++++++++++++++
 5 files changed, 126 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8219195d/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 8fee595..ca4780a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 1.2.1
+ * add threadpool size adjustment methods to JMXEnabledThreadPoolExecutor and 
+   CompactionManagerMBean (CASSANDRA-5044)
  * Improve handling a changing target throttle rate mid-compaction (CASSANDRA-5087)
  * fix hinting for dropped local writes (CASSANDRA-4753)
  * off-heap cache doesn't need mutable column container (CASSANDRA-5057)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8219195d/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutor.java b/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutor.java
index 52f9453..de448b5 100644
--- a/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutor.java
+++ b/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutor.java
@@ -159,6 +159,26 @@ public class JMXEnabledThreadPoolExecutor extends DebuggableThreadPoolExecutor
i
         return (int) metrics.currentBlocked.count();
     }
 
+    public int getCoreThreads()
+    {
+        return getCorePoolSize();
+    }
+
+    public void setCoreThreads(int number)
+    {
+        setCorePoolSize(number);
+    }
+
+    public int getMaximumThreads()
+    {
+        return getMaximumPoolSize();
+    }
+
+    public void setMaximumThreads(int number)
+    {
+        setMaximumPoolSize(number);
+    }
+
     @Override
     protected void onInitialRejection(Runnable task)
     {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8219195d/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutorMBean.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutorMBean.java
b/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutorMBean.java
index 48136bc..ed2a2ac 100644
--- a/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutorMBean.java
+++ b/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutorMBean.java
@@ -34,4 +34,24 @@ public interface JMXEnabledThreadPoolExecutorMBean extends IExecutorMBean
      * the executor (because all threads are busy and the backing queue is full).
      */
     public int getCurrentlyBlockedTasks();
+
+    /**
+     * Returns core pool size of thread pool.
+     */
+    public int getCoreThreads();
+
+    /**
+     * Allows user to resize core pool size of the thread pool.
+     */
+    public void setCoreThreads(int number);
+
+    /**
+     * Returns maximum pool size of thread pool.
+     */
+    public int getMaximumThreads();
+
+    /**
+     * Allows user to resize maximum size of the thread pool.
+     */
+    public void setMaximumThreads(int number);
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8219195d/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
index 0a31888..4f0290f 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
@@ -1126,6 +1126,46 @@ public class CompactionManager implements CompactionManagerMBean
         }
     }
 
+    public int getCoreCompactorThreads()
+    {
+        return executor.getCorePoolSize();
+    }
+
+    public void setCoreCompactorThreads(int number)
+    {
+        executor.setCorePoolSize(number);
+    }
+
+    public int getMaximumCompactorThreads()
+    {
+        return executor.getMaximumPoolSize();
+    }
+
+    public void setMaximumCompactorThreads(int number)
+    {
+        executor.setMaximumPoolSize(number);
+    }
+
+    public int getCoreValidationThreads()
+    {
+        return validationExecutor.getCorePoolSize();
+    }
+
+    public void setCoreValidationThreads(int number)
+    {
+        validationExecutor.setCorePoolSize(number);
+    }
+
+    public int getMaximumValidatorThreads()
+    {
+        return validationExecutor.getMaximumPoolSize();
+    }
+
+    public void setMaximumValidatorThreads(int number)
+    {
+        validationExecutor.setMaximumPoolSize(number);
+    }
+
     /**
      * Try to stop all of the compactions for given ColumnFamilies.
      * Note that this method does not wait indefinitely for all compactions to finish, maximum
wait time is 30 secs.

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8219195d/src/java/org/apache/cassandra/db/compaction/CompactionManagerMBean.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionManagerMBean.java b/src/java/org/apache/cassandra/db/compaction/CompactionManagerMBean.java
index db44344..e24e79c 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionManagerMBean.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionManagerMBean.java
@@ -74,4 +74,48 @@ public interface CompactionManagerMBean
      *   - INDEX_BUILD
      */
     public void stopCompaction(String type);
+
+    /**
+     * Returns core size of compaction thread pool
+     */
+    public int getCoreCompactorThreads();
+
+    /**
+     * Allows user to resize maximum size of the compaction thread pool.
+     * @param number New maximum of compaction threads
+     */
+    public void setCoreCompactorThreads(int number);
+
+    /**
+     * Returns maximum size of compaction thread pool
+     */
+    public int getMaximumCompactorThreads();
+
+    /**
+     * Allows user to resize maximum size of the compaction thread pool.
+     * @param number New maximum of compaction threads
+     */
+    public void setMaximumCompactorThreads(int number);
+
+    /**
+     * Returns core size of validation thread pool
+     */
+    public int getCoreValidationThreads();
+
+    /**
+     * Allows user to resize maximum size of the compaction thread pool.
+     * @param number New maximum of compaction threads
+     */
+    public void setCoreValidationThreads(int number);
+
+    /**
+     * Returns size of validator thread pool
+     */
+    public int getMaximumValidatorThreads();
+
+    /**
+     * Allows user to resize maximum size of the validator thread pool.
+     * @param number New maximum of validator threads
+     */
+    public void setMaximumValidatorThreads(int number);
 }


Mime
View raw message