hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nkey...@apache.org
Subject svn commit: r1563878 - /hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
Date Mon, 03 Feb 2014 13:19:49 GMT
Author: nkeywal
Date: Mon Feb  3 13:19:49 2014
New Revision: 1563878

URL: http://svn.apache.org/r1563878
Log:
HBASE-10449 Wrong execution pool configuration in HConnectionManager

Modified:
    hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java

Modified: hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java?rev=1563878&r1=1563877&r2=1563878&view=diff
==============================================================================
--- hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
(original)
+++ hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
Mon Feb  3 13:19:49 2014
@@ -766,22 +766,27 @@ public class HConnectionManager {
         synchronized (this) {
           if (batchPool == null) {
             int maxThreads = conf.getInt("hbase.hconnection.threads.max", 256);
-            int coreThreads = conf.getInt("hbase.hconnection.threads.core", 0);
+            int coreThreads = conf.getInt("hbase.hconnection.threads.core", 256);
             if (maxThreads == 0) {
               maxThreads = Runtime.getRuntime().availableProcessors() * 8;
             }
-            long keepAliveTime = conf.getLong("hbase.hconnection.threads.keepalivetime",
10);
+            if (coreThreads == 0) {
+              coreThreads = Runtime.getRuntime().availableProcessors() * 8;
+            }
+            long keepAliveTime = conf.getLong("hbase.hconnection.threads.keepalivetime",
60);
             LinkedBlockingQueue<Runnable> workQueue =
               new LinkedBlockingQueue<Runnable>(maxThreads *
                 conf.getInt(HConstants.HBASE_CLIENT_MAX_TOTAL_TASKS,
                   HConstants.DEFAULT_HBASE_CLIENT_MAX_TOTAL_TASKS));
-            this.batchPool = new ThreadPoolExecutor(
+            ThreadPoolExecutor tpe = new ThreadPoolExecutor(
                 coreThreads,
                 maxThreads,
                 keepAliveTime,
                 TimeUnit.SECONDS,
                 workQueue,
                 Threads.newDaemonThreadFactory(toString() + "-shared-"));
+            tpe.allowCoreThreadTimeOut(true);
+            this.batchPool = tpe;
           }
           this.cleanupPool = true;
         }



Mime
View raw message