diff --git a/CHANGES.txt b/CHANGES.txt index 280bf66e9b4..c4d6a919892 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -833,6 +833,11 @@ Release 0.92.0 - Unreleased HBASE-2742 Provide strong authentication with a secure RPC engine HBASE-3025 Coprocessor based access control +Release 0.90.6 - Unreleased + + BUG FIXES + HBASE-4970 Add a parameter so that keepAliveTime of Htable thread pool can be changed (gaojinchao) + Release 0.90.5 - Unreleased BUG FIXES diff --git a/src/main/java/org/apache/hadoop/hbase/client/HTable.java b/src/main/java/org/apache/hadoop/hbase/client/HTable.java index e59f99c85c0..8cc64442d3a 100644 --- a/src/main/java/org/apache/hadoop/hbase/client/HTable.java +++ b/src/main/java/org/apache/hadoop/hbase/client/HTable.java @@ -169,12 +169,14 @@ public class HTable implements HTableInterface, Closeable { if (maxThreads == 0) { maxThreads = 1; // is there a better default? } + long keepAliveTime = conf.getLong("hbase.htable.threads.keepalivetime", 60); + // Using the "direct handoff" approach, new threads will only be created // 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, - 60, TimeUnit.SECONDS, + keepAliveTime, TimeUnit.SECONDS, new SynchronousQueue(), new DaemonThreadFactory()); ((ThreadPoolExecutor)this.pool).allowCoreThreadTimeOut(true);