hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject [09/13] hadoop git commit: HADOOP-15253. Should update maxQueueSize when refresh call queue. Contributed by Tao Jie.
Date Sat, 31 Mar 2018 02:34:04 GMT
HADOOP-15253. Should update maxQueueSize when refresh call queue. Contributed by Tao Jie.

(cherry picked from commit acfd764fcc9990e507c0e7cea746652375aaa632)

Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/4ce45a8e
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/4ce45a8e
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/4ce45a8e

Branch: refs/heads/branch-3.1
Commit: 4ce45a8ec7b8109bc14ac47862f0ccbe7cdfa194
Parents: e96c7bf
Author: Konstantin V Shvachko <shv@apache.org>
Authored: Fri Mar 30 18:55:35 2018 -0700
Committer: Konstantin V Shvachko <shv@apache.org>
Committed: Fri Mar 30 18:57:18 2018 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/ipc/Server.java    |  3 +++
 .../org/apache/hadoop/TestRefreshCallQueue.java    | 17 +++++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/4ce45a8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java
index d0694fb..c5da3b1 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java
@@ -657,6 +657,9 @@ public abstract class Server {
   public synchronized void refreshCallQueue(Configuration conf) {
     // Create the next queue
     String prefix = getQueueClassPrefix();
+    this.maxQueueSize = handlerCount * conf.getInt(
+        CommonConfigurationKeys.IPC_SERVER_HANDLER_QUEUE_SIZE_KEY,
+        CommonConfigurationKeys.IPC_SERVER_HANDLER_QUEUE_SIZE_DEFAULT);
     callQueue.swapQueue(getSchedulerClass(prefix, conf),
         getQueueClass(prefix, conf), maxQueueSize, prefix, conf);
   }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4ce45a8e/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/TestRefreshCallQueue.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/TestRefreshCallQueue.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/TestRefreshCallQueue.java
index d5eb9cf..faac1c0 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/TestRefreshCallQueue.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/TestRefreshCallQueue.java
@@ -30,8 +30,10 @@ import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
 
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.CommonConfigurationKeys;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hdfs.DFSConfigKeys;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer;
 import org.apache.hadoop.hdfs.tools.DFSAdmin;
@@ -141,8 +143,16 @@ public class TestRefreshCallQueue {
 
     // throw an error when we double-initialize JvmMetrics
     DefaultMetricsSystem.setMiniClusterMode(false);
-
+    int serviceHandlerCount = config.getInt(
+        DFSConfigKeys.DFS_NAMENODE_SERVICE_HANDLER_COUNT_KEY,
+        DFSConfigKeys.DFS_NAMENODE_SERVICE_HANDLER_COUNT_DEFAULT);
     NameNodeRpcServer rpcServer = (NameNodeRpcServer) cluster.getNameNodeRpc();
+    // check callqueue size
+    assertEquals(CommonConfigurationKeys.IPC_SERVER_HANDLER_QUEUE_SIZE_DEFAULT
+        * serviceHandlerCount, rpcServer.getClientRpcServer().getMaxQueueSize());
+    // Replace queue and update queue size
+    config.setInt(CommonConfigurationKeys.IPC_SERVER_HANDLER_QUEUE_SIZE_KEY,
+        150);
     try {
       rpcServer.getClientRpcServer().refreshCallQueue(config);
     } catch (Exception e) {
@@ -158,6 +168,9 @@ public class TestRefreshCallQueue {
     } finally {
       DefaultMetricsSystem.setMiniClusterMode(oldValue);
     }
-  }
+    // check callQueueSize has changed
+    assertEquals(150 * serviceHandlerCount, rpcServer.getClientRpcServer()
+        .getMaxQueueSize());
+ }
 
 }
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message