You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by zh...@apache.org on 2023/02/14 05:51:11 UTC

[rocketmq] 16/18: Put batchDispatchRequestThreadPoolNums config to MessageStoreConfig.java

This is an automated email from the ASF dual-hosted git repository.

zhouxzhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git

commit 07e65d37d0c76f12b231500046c2af0ed9755c86
Author: nowinkey <no...@tom.com>
AuthorDate: Mon Feb 13 21:04:07 2023 +0800

    Put batchDispatchRequestThreadPoolNums config to MessageStoreConfig.java
---
 .../src/main/java/org/apache/rocketmq/common/BrokerConfig.java | 10 ----------
 .../java/org/apache/rocketmq/store/DefaultMessageStore.java    |  4 ++--
 .../org/apache/rocketmq/store/config/MessageStoreConfig.java   | 10 ++++++++++
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/common/src/main/java/org/apache/rocketmq/common/BrokerConfig.java b/common/src/main/java/org/apache/rocketmq/common/BrokerConfig.java
index 454b96cd5..50874da08 100644
--- a/common/src/main/java/org/apache/rocketmq/common/BrokerConfig.java
+++ b/common/src/main/java/org/apache/rocketmq/common/BrokerConfig.java
@@ -394,8 +394,6 @@ public class BrokerConfig extends BrokerIdentity {
     private long channelExpiredTimeout = 1000 * 120;
     private long subscriptionExpiredTimeout = 1000 * 60 * 10;
 
-    private int batchDispatchRequestThreadPoolNums = 16;
-
     /**
      * Estimate accumulation or not when subscription filter type is tag and is not SUB_ALL.
      */
@@ -1649,12 +1647,4 @@ public class BrokerConfig extends BrokerIdentity {
     public void setEstimateAccumulation(boolean estimateAccumulation) {
         this.estimateAccumulation = estimateAccumulation;
     }
-
-    public int getBatchDispatchRequestThreadPoolNums() {
-        return batchDispatchRequestThreadPoolNums;
-    }
-
-    public void setBatchDispatchRequestThreadPoolNums(int batchDispatchRequestThreadPoolNums) {
-        this.batchDispatchRequestThreadPoolNums = batchDispatchRequestThreadPoolNums;
-    }
 }
diff --git a/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java b/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java
index 43052e2a8..69dd86897 100644
--- a/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java
+++ b/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java
@@ -2841,8 +2841,8 @@ public class DefaultMessageStore implements MessageStore {
 
         public MainBatchDispatchRequestService() {
             batchDispatchRequestExecutor = new ThreadPoolExecutor(
-                    DefaultMessageStore.this.getBrokerConfig().getBatchDispatchRequestThreadPoolNums(),
-                    DefaultMessageStore.this.getBrokerConfig().getBatchDispatchRequestThreadPoolNums(),
+                    DefaultMessageStore.this.getMessageStoreConfig().getBatchDispatchRequestThreadPoolNums(),
+                    DefaultMessageStore.this.getMessageStoreConfig().getBatchDispatchRequestThreadPoolNums(),
                     1000 * 60,
                     TimeUnit.MICROSECONDS,
                     new LinkedBlockingQueue<>(4096),
diff --git a/store/src/main/java/org/apache/rocketmq/store/config/MessageStoreConfig.java b/store/src/main/java/org/apache/rocketmq/store/config/MessageStoreConfig.java
index a55a41df3..0f673be54 100644
--- a/store/src/main/java/org/apache/rocketmq/store/config/MessageStoreConfig.java
+++ b/store/src/main/java/org/apache/rocketmq/store/config/MessageStoreConfig.java
@@ -381,6 +381,8 @@ public class MessageStoreConfig {
      */
     private boolean enableBuildConsumeQueueConcurrently = false;
 
+    private int batchDispatchRequestThreadPoolNums = 16;
+
     public boolean isDebugLockEnable() {
         return debugLockEnable;
     }
@@ -1613,4 +1615,12 @@ public class MessageStoreConfig {
     public void setEnableBuildConsumeQueueConcurrently(boolean enableBuildConsumeQueueConcurrently) {
         this.enableBuildConsumeQueueConcurrently = enableBuildConsumeQueueConcurrently;
     }
+
+    public int getBatchDispatchRequestThreadPoolNums() {
+        return batchDispatchRequestThreadPoolNums;
+    }
+
+    public void setBatchDispatchRequestThreadPoolNums(int batchDispatchRequestThreadPoolNums) {
+        this.batchDispatchRequestThreadPoolNums = batchDispatchRequestThreadPoolNums;
+    }
 }