You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by br...@apache.org on 2010/07/28 23:30:24 UTC

svn commit: r980234 - /incubator/thrift/trunk/lib/java/src/org/apache/thrift/server/THsHaServer.java

Author: bryanduxbury
Date: Wed Jul 28 21:30:24 2010
New Revision: 980234

URL: http://svn.apache.org/viewvc?rev=980234&view=rev
Log:
THRIFT-714. java: maxWorkerThreads parameter to THsHaServer has no effect

This patch removes the non-functioning maxWorkerThreads option and renames minWorkerThreads to workerThreads.

Modified:
    incubator/thrift/trunk/lib/java/src/org/apache/thrift/server/THsHaServer.java

Modified: incubator/thrift/trunk/lib/java/src/org/apache/thrift/server/THsHaServer.java
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/java/src/org/apache/thrift/server/THsHaServer.java?rev=980234&r1=980233&r2=980234&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/java/src/org/apache/thrift/server/THsHaServer.java (original)
+++ incubator/thrift/trunk/lib/java/src/org/apache/thrift/server/THsHaServer.java Wed Jul 28 21:30:24 2010
@@ -42,10 +42,9 @@ public class THsHaServer extends TNonblo
   // for the passing of Invocations from the Selector to workers.
   private ExecutorService invoker;
 
-  protected final int MIN_WORKER_THREADS;
-  protected final int MAX_WORKER_THREADS;
-  protected final int STOP_TIMEOUT_VAL;
-  protected final TimeUnit STOP_TIMEOUT_UNIT;
+  protected final int worker_threads;
+  protected final int stop_timeout_val;
+  protected final TimeUnit stop_timeout_unit;
 
   /**
    * Create server with given processor, and server transport. Default server
@@ -202,10 +201,9 @@ public class THsHaServer extends TNonblo
       inputProtocolFactory, outputProtocolFactory,
       options);
 
-    MIN_WORKER_THREADS = options.minWorkerThreads;
-    MAX_WORKER_THREADS = options.maxWorkerThreads;
-    STOP_TIMEOUT_VAL = options.stopTimeoutVal;
-    STOP_TIMEOUT_UNIT = options.stopTimeoutUnit;
+    worker_threads = options.workerThreads;
+    stop_timeout_val = options.stopTimeoutVal;
+    stop_timeout_unit = options.stopTimeoutUnit;
   }
 
   /** @inheritDoc */
@@ -239,8 +237,8 @@ public class THsHaServer extends TNonblo
   protected boolean startInvokerPool() {
     // start the invoker pool
     LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>();
-    invoker = new ThreadPoolExecutor(MIN_WORKER_THREADS, MAX_WORKER_THREADS,
-      STOP_TIMEOUT_VAL, STOP_TIMEOUT_UNIT, queue);
+    invoker = new ThreadPoolExecutor(worker_threads, worker_threads,
+      stop_timeout_val, stop_timeout_unit, queue);
 
     return true;
   }
@@ -295,8 +293,7 @@ public class THsHaServer extends TNonblo
   }
 
   public static class Options extends TNonblockingServer.Options {
-    public int minWorkerThreads = 5;
-    public int maxWorkerThreads = Integer.MAX_VALUE;
+    public int workerThreads = 5;
     public int stopTimeoutVal = 60;
     public TimeUnit stopTimeoutUnit = TimeUnit.SECONDS;
   }