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

zhangduo pushed a commit to branch branch-2.5
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.5 by this push:
     new 25c375e1860 HBASE-20499 Replication/Priority executors can use 
specific max queue length as default value instead of general maxQueueLength
25c375e1860 is described below

commit 25c375e18609e693ea9da983d91a9f38f33a5d5c
Author: Nihal Jain <[email protected]>
AuthorDate: Fri Apr 27 14:13:57 2018 +0530

    HBASE-20499 Replication/Priority executors can use specific max queue 
length as default value instead of general maxQueueLength
    
    Signed-off-by: tedyu <[email protected]>
    (cherry picked from commit 6d080762ef795adf02dd0ab236c4b3eb73e19a91)
---
 .../src/main/java/org/apache/hadoop/hbase/ipc/RpcExecutor.java |  8 ++++++--
 .../main/java/org/apache/hadoop/hbase/ipc/RpcScheduler.java    |  2 ++
 .../java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java   | 10 +++++++---
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcExecutor.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcExecutor.java
index ef163640e51..e00ca6a991c 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcExecutor.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcExecutor.java
@@ -438,8 +438,12 @@ public abstract class RpcExecutor {
    */
   public void resizeQueues(Configuration conf) {
     String configKey = RpcScheduler.IPC_SERVER_MAX_CALLQUEUE_LENGTH;
-    if (name != null && name.toLowerCase(Locale.ROOT).contains("priority")) {
-      configKey = RpcScheduler.IPC_SERVER_PRIORITY_MAX_CALLQUEUE_LENGTH;
+    if (name != null) {
+      if (name.toLowerCase(Locale.ROOT).contains("priority")) {
+        configKey = RpcScheduler.IPC_SERVER_PRIORITY_MAX_CALLQUEUE_LENGTH;
+      } else if (name.toLowerCase(Locale.ROOT).contains("replication")) {
+        configKey = RpcScheduler.IPC_SERVER_REPLICATION_MAX_CALLQUEUE_LENGTH;
+      }
     }
     final int queueLimit = currentQueueLimit;
     currentQueueLimit = conf.getInt(configKey, queueLimit);
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcScheduler.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcScheduler.java
index d81b3224901..0d0a1f8659c 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcScheduler.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcScheduler.java
@@ -33,6 +33,8 @@ public abstract class RpcScheduler {
     "hbase.ipc.server.max.callqueue.length";
   public static final String IPC_SERVER_PRIORITY_MAX_CALLQUEUE_LENGTH =
     "hbase.ipc.server.priority.max.callqueue.length";
+  public static final String IPC_SERVER_REPLICATION_MAX_CALLQUEUE_LENGTH =
+    "hbase.ipc.server.replication.max.callqueue.length";
 
   /** Exposes runtime information of a {@code RpcServer} that a {@code 
RpcScheduler} may need. */
   public static abstract class Context {
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java
index bb8025ca911..b68968d8135 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcScheduler.java
@@ -66,8 +66,11 @@ public class SimpleRpcScheduler extends RpcScheduler 
implements ConfigurationObs
 
     int maxQueueLength = 
conf.getInt(RpcScheduler.IPC_SERVER_MAX_CALLQUEUE_LENGTH,
       handlerCount * RpcServer.DEFAULT_MAX_CALLQUEUE_LENGTH_PER_HANDLER);
-    int maxPriorityQueueLength =
-      conf.getInt(RpcScheduler.IPC_SERVER_PRIORITY_MAX_CALLQUEUE_LENGTH, 
maxQueueLength);
+    int maxPriorityQueueLength = 
conf.getInt(RpcScheduler.IPC_SERVER_PRIORITY_MAX_CALLQUEUE_LENGTH,
+      priorityHandlerCount * 
RpcServer.DEFAULT_MAX_CALLQUEUE_LENGTH_PER_HANDLER);
+    int maxReplicationQueueLength =
+      conf.getInt(RpcScheduler.IPC_SERVER_REPLICATION_MAX_CALLQUEUE_LENGTH,
+        replicationHandlerCount * 
RpcServer.DEFAULT_MAX_CALLQUEUE_LENGTH_PER_HANDLER);
 
     this.priority = priority;
     this.highPriorityLevel = highPriorityLevel;
@@ -111,7 +114,8 @@ public class SimpleRpcScheduler extends RpcScheduler 
implements ConfigurationObs
     }
     this.replicationExecutor = replicationHandlerCount > 0
       ? new FastPathBalancedQueueRpcExecutor("replication.FPBQ", 
replicationHandlerCount,
-        RpcExecutor.CALL_QUEUE_TYPE_FIFO_CONF_VALUE, maxQueueLength, priority, 
conf, abortable)
+        RpcExecutor.CALL_QUEUE_TYPE_FIFO_CONF_VALUE, 
maxReplicationQueueLength, priority, conf,
+        abortable)
       : null;
 
     this.metaTransitionExecutor = metaTransitionHandler > 0

Reply via email to