Browse Source

commit 11a45ea121978f2409c1ec3581053f77122f7f97
Author: Suresh Srinivas <sureshms@yahoo-inc.com>
Date: Fri Feb 26 16:56:52 2010 -0800

Hadoop-1849 from https://issues.apache.org/jira/secure/attachment/12437092/handlerQueueSizeConfig-0.20.patch

+++ b/YAHOO-CHANGES.txt
+
+ HADOOP-1849. Add undocumented configuration parameter for per handler
+ call queue size in IPC Server. (shv)
+


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security-patches@1077235 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 14 years ago
parent
commit
ce0beba142
1 changed files with 6 additions and 2 deletions
  1. 6 2
      src/core/org/apache/hadoop/ipc/Server.java

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

@@ -100,7 +100,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";
   
   /**
    * Initial and max size of response buffer
@@ -1286,7 +1288,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.maxRespSize = conf.getInt(IPC_SERVER_RPC_MAX_RESPONSE_SIZE_KEY,
                                    IPC_SERVER_RPC_MAX_RESPONSE_SIZE_DEFAULT);
     this.callQueue  = new LinkedBlockingQueue<Call>(maxQueueSize);