ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: # ignite-773: thread pool management - allow to configure utility cache and marshaller size
Date Tue, 21 Apr 2015 14:48:47 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-773 [created] 0b1865217


# ignite-773: thread pool management - allow to configure utility cache and marshaller size


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0b186521
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0b186521
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0b186521

Branch: refs/heads/ignite-773
Commit: 0b1865217fc6261e89e15268841f7ba3637d37a8
Parents: 700cf08
Author: Artem Shutak <ashutak@gridgain.com>
Authored: Tue Apr 21 17:49:09 2015 +0300
Committer: Artem Shutak <ashutak@gridgain.com>
Committed: Tue Apr 21 17:49:09 2015 +0300

----------------------------------------------------------------------
 .../configuration/IgniteConfiguration.java      | 104 +++++++++++++++++++
 .../org/apache/ignite/internal/IgnitionEx.java  |   8 +-
 2 files changed, 108 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0b186521/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
index 101d8a7..e9d3ff4 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
@@ -205,6 +205,18 @@ public class IgniteConfiguration {
     /** IGFS pool size. */
     private int igfsPoolSize = AVAILABLE_PROC_CNT;
 
+    /** Default utility cache pool size. */
+    private int utilityCacheDfltPoolSize = DFLT_SYSTEM_CORE_THREAD_CNT;
+
+    /** Maximim utility cache pool size. */
+    private int utilityCacheMaxPoolSize = DFLT_SYSTEM_MAX_THREAD_CNT;
+
+    /** Default marshller pool size. */
+    private int marshDfltPoolSize = DFLT_SYSTEM_CORE_THREAD_CNT;
+
+    /** Maximim marshaller pool size. */
+    private int marshMaxPoolSize = DFLT_SYSTEM_MAX_THREAD_CNT;
+
     /** P2P pool size. */
     private int p2pPoolSize = DFLT_P2P_THREAD_CNT;
 
@@ -442,6 +454,8 @@ public class IgniteConfiguration {
         lsnrs = cfg.getLocalEventListeners();
         marsh = cfg.getMarshaller();
         marshLocJobs = cfg.isMarshalLocalJobs();
+        marshDfltPoolSize = cfg.getMarshallerDefaultThreadPoolSize();
+        marshMaxPoolSize = cfg.getMarshallerMaximumThreadPoolSize();
         mbeanSrv = cfg.getMBeanServer();
         metricsHistSize = cfg.getMetricsHistorySize();
         metricsExpTime = cfg.getMetricsExpireTime();
@@ -467,6 +481,8 @@ public class IgniteConfiguration {
         timeSrvPortRange = cfg.getTimeServerPortRange();
         txCfg = cfg.getTransactionConfiguration();
         userAttrs = cfg.getUserAttributes();
+        utilityCacheDfltPoolSize = cfg.getUtilityCacheDefaultThreadPoolSize();
+        utilityCacheMaxPoolSize = cfg.getUtilityCacheMaximumThreadPoolSize();
         waitForSegOnStart = cfg.isWaitForSegmentOnStart();
         warmupClos = cfg.getWarmupClosure();
     }
@@ -648,6 +664,50 @@ public class IgniteConfiguration {
     }
 
     /**
+     * Default size of thread pool that is in charge of processing utility cache messages.
+     * <p>
+     * If not provided, executor service will have size {@link #DFLT_SYSTEM_CORE_THREAD_CNT}.
+     *
+     * @return Default thread pool size to be used in grid for utility cache messages.
+     */
+    public int getUtilityCacheDefaultThreadPoolSize() {
+        return utilityCacheDfltPoolSize;
+    }
+
+    /**
+     * Maximum size of thread pool that is in charge of processing utility cache messages.
+     * <p>
+     * If not provided, executor service will have size {@link #DFLT_SYSTEM_MAX_THREAD_CNT}.
+     *
+     * @return Maximum thread pool size to be used in grid for utility cache messages.
+     */
+    public int getUtilityCacheMaximumThreadPoolSize() {
+        return utilityCacheMaxPoolSize;
+    }
+
+    /**
+     * Default size of thread pool that is in charge of processing marshaller messages.
+     * <p>
+     * If not provided, executor service will have size {@link #DFLT_SYSTEM_CORE_THREAD_CNT}.
+     *
+     * @return Default thread pool size to be used in grid for marshaller messages.
+     */
+    public int getMarshallerDefaultThreadPoolSize() {
+        return marshDfltPoolSize;
+    }
+
+    /**
+     * Maximum size of thread pool that is in charge of processing marshaller messages.
+     * <p>
+     * If not provided, executor service will have size {@link #DFLT_SYSTEM_MAX_THREAD_CNT}.
+     *
+     * @return Maximum thread pool size to be used in grid for marshaller messages.
+     */
+    public int getMarshallerMaximumThreadPoolSize() {
+        return marshMaxPoolSize;
+    }
+
+    /**
      * Sets thread pool size to use within grid.
      *
      * @param poolSize Thread pool size to use within grid.
@@ -698,6 +758,50 @@ public class IgniteConfiguration {
     }
 
     /**
+     * Sets default thread pool size that will be used to process utility cache messages.
+     *
+     * @param poolSize Default executor service size to use for utility cache messages.
+     * @see IgniteConfiguration#getUtilityCacheDefaultThreadPoolSize()
+     * @see IgniteConfiguration#getUtilityCacheMaximumThreadPoolSize()
+     */
+    public void setUtilityCacheDefaultPoolSize(int poolSize) {
+        utilityCacheDfltPoolSize = poolSize;
+    }
+
+    /**
+     * Sets maximum thread pool size that will be used to process utility cache messages.
+     *
+     * @param poolSize Maximum executor service size to use for utility cache messages.
+     * @see IgniteConfiguration#getUtilityCacheDefaultThreadPoolSize()
+     * @see IgniteConfiguration#getUtilityCacheMaximumThreadPoolSize()
+     */
+    public void setUtilityCacheMaximumPoolSize(int poolSize) {
+        utilityCacheMaxPoolSize = poolSize;
+    }
+
+    /**
+     * Sets default thread pool size that will be used to process marshaller messages.
+     *
+     * @param poolSize Default executor service size to use for marshaller messages.
+     * @see IgniteConfiguration#getMarshallerDefaultThreadPoolSize()
+     * @see IgniteConfiguration#getMarshallerMaximumThreadPoolSize()
+     */
+    public void setMarshallerDefaultPoolSize(int poolSize) {
+        marshDfltPoolSize = poolSize;
+    }
+
+    /**
+     * Sets maximum thread pool size that will be used to process marshaller messages.
+     *
+     * @param poolSize Maximum executor service size to use for marshaller messages.
+     * @see IgniteConfiguration#getMarshallerDefaultThreadPoolSize()
+     * @see IgniteConfiguration#getMarshallerMaximumThreadPoolSize()
+     */
+    public void setMarshallerMaximumPoolSize(int poolSize) {
+        marshMaxPoolSize = poolSize;
+    }
+
+    /**
      * Should return Ignite installation home folder. If not provided, the system will check
      * {@code IGNITE_HOME} system property and environment variable in that order. If
      * {@code IGNITE_HOME} still could not be obtained, then grid will not start and exception

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0b186521/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index ac9bc33..55c3628 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -1418,15 +1418,15 @@ public class IgnitionEx {
 
             utilityCacheExecSvc = new IgniteThreadPoolExecutor(
                 "utility-" + cfg.getGridName(),
-                DFLT_SYSTEM_CORE_THREAD_CNT,
-                DFLT_SYSTEM_MAX_THREAD_CNT,
+                myCfg.getUtilityCacheDefaultThreadPoolSize(),
+                myCfg.getUtilityCacheMaximumThreadPoolSize(),
                 DFLT_SYSTEM_KEEP_ALIVE_TIME,
                 new LinkedBlockingQueue<Runnable>(DFLT_SYSTEM_THREADPOOL_QUEUE_CAP));
 
             marshCacheExecSvc = new IgniteThreadPoolExecutor(
                 "marshaller-cache-" + cfg.getGridName(),
-                DFLT_SYSTEM_CORE_THREAD_CNT,
-                DFLT_SYSTEM_MAX_THREAD_CNT,
+                myCfg.getMarshallerDefaultThreadPoolSize(),
+                myCfg.getMarshallerMaximumThreadPoolSize(),
                 DFLT_SYSTEM_KEEP_ALIVE_TIME,
                 new LinkedBlockingQueue<Runnable>(DFLT_SYSTEM_THREADPOOL_QUEUE_CAP));
 


Mime
View raw message