Browse Source

HADOOP-1849. Merge -r 916528:916529 from trunk to branch-0.20.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20@916531 13f79535-47bb-0310-9956-ffa450edef68
Konstantin Shvachko 15 years ago
parent
commit
33932493ae
2 changed files with 9 additions and 2 deletions
  1. 3 0
      CHANGES.txt
  2. 6 2
      src/core/org/apache/hadoop/ipc/Server.java

+ 3 - 0
CHANGES.txt

@@ -126,6 +126,9 @@ Release 0.20.2 - 2010-2-19
     HADOOP-5612. Some c++ scripts are not chmodded before ant execution.
     (Todd Lipcon via tomwhite)
 
+    HADOOP-1849. Add undocumented configuration parameter for per handler 
+    call queue size in IPC Server. (shv)
+
 Release 0.20.1 - 2009-09-01
 
   INCOMPATIBLE CHANGES

+ 6 - 2
src/core/org/apache/hadoop/ipc/Server.java

@@ -88,7 +88,9 @@ public abstract class Server {
   /**
    * How many calls/handler are allowed in the queue.
    */
-  private static final int MAX_QUEUE_SIZE_PER_HANDLER = 100;
+  private static final int IPC_SERVER_HANDLER_QUEUE_SIZE_DEFAULT = 100;
+  private static final String  IPC_SERVER_HANDLER_QUEUE_SIZE_KEY = 
+                                            "ipc.server.handler.queue.size";
   
   public static final Log LOG = LogFactory.getLog(Server.class);
 
@@ -1016,7 +1018,9 @@ public abstract class Server {
     this.paramClass = paramClass;
     this.handlerCount = handlerCount;
     this.socketSendBufferSize = 0;
-    this.maxQueueSize = handlerCount * MAX_QUEUE_SIZE_PER_HANDLER;
+    this.maxQueueSize = handlerCount * conf.getInt(
+                                IPC_SERVER_HANDLER_QUEUE_SIZE_KEY,
+                                IPC_SERVER_HANDLER_QUEUE_SIZE_DEFAULT);
     this.callQueue  = new LinkedBlockingQueue<Call>(maxQueueSize); 
     this.maxIdleTime = 2*conf.getInt("ipc.client.connection.maxidletime", 1000);
     this.maxConnectionsToNuke = conf.getInt("ipc.client.kill.max", 10);