commit e05d536d1869cb00aa5d71a1d4ee9756739e19d7 Author: nspiegelberg Date: 84 seconds ago HBASE-4787 Make corePool as a configurable parameter in HTable diff --git src/main/java/org/apache/hadoop/hbase/client/HTable.java src/main/java/org/apache/hadoop/hbase/client/HTable.java index 3a5fbd2..78f9ac3 100644 --- src/main/java/org/apache/hadoop/hbase/client/HTable.java +++ src/main/java/org/apache/hadoop/hbase/client/HTable.java @@ -180,6 +180,7 @@ public class HTable implements HTableInterface, Closeable { HConstants.DEFAULT_HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE); this.maxKeyValueSize = conf.getInt("hbase.client.keyvalue.maxsize", -1); + int corePools = conf.getInt("hbase.htable.threads.corePool", 1); int maxThreads = conf.getInt("hbase.htable.threads.max", Integer.MAX_VALUE); if (maxThreads == 0) { maxThreads = 1; // is there a better default? @@ -189,7 +190,7 @@ public class HTable implements HTableInterface, Closeable { // if it is necessary and will grow unbounded. This could be bad but in HCM // we only create as many Runnables as there are region servers. It means // it also scales when new region servers are added. - this.pool = new ThreadPoolExecutor(1, maxThreads, + this.pool = new ThreadPoolExecutor(corePools, maxThreads, 60, TimeUnit.SECONDS, new SynchronousQueue(), new DaemonThreadFactory()); @@ -1394,7 +1395,7 @@ public class HTable implements HTableInterface, Closeable { SecurityManager s = System.getSecurityManager(); group = (s != null)? s.getThreadGroup() : Thread.currentThread().getThreadGroup(); - namePrefix = "pool-" + + namePrefix = "hbase-table-pool" + poolNumber.getAndIncrement() + "-thread-"; }