Skip to content

Commit dff8e50

Browse files
authored
HBASE-27565 Make the initial corePoolSize configurable for ChoreService (#4958)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
1 parent c1b9d8b commit dff8e50

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

hbase-common/src/main/java/org/apache/hadoop/hbase/ChoreService.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ public class ChoreService {
5959
*/
6060
@InterfaceAudience.Private
6161
public final static int MIN_CORE_POOL_SIZE = 1;
62+
/**
63+
* The initial number of threads in the core pool for the {@link ChoreService}.
64+
*/
65+
public static final String CHORE_SERVICE_INITIAL_POOL_SIZE =
66+
"hbase.choreservice.initial.pool.size";
67+
public static final int DEFAULT_CHORE_SERVICE_INITIAL_POOL_SIZE = 1;
6268

6369
/**
6470
* This thread pool is used to schedule all of the Chores

hbase-server/src/main/java/org/apache/hadoop/hbase/HBaseServerBase.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
*/
1818
package org.apache.hadoop.hbase;
1919

20+
import static org.apache.hadoop.hbase.ChoreService.CHORE_SERVICE_INITIAL_POOL_SIZE;
21+
import static org.apache.hadoop.hbase.ChoreService.DEFAULT_CHORE_SERVICE_INITIAL_POOL_SIZE;
2022
import static org.apache.hadoop.hbase.HConstants.DEFAULT_HBASE_SPLIT_COORDINATED_BY_ZK;
2123
import static org.apache.hadoop.hbase.HConstants.HBASE_SPLIT_WAL_COORDINATED_BY_ZK;
2224

@@ -278,7 +280,9 @@ public HBaseServerBase(Configuration conf, String name) throws IOException {
278280

279281
initializeFileSystem();
280282

281-
this.choreService = new ChoreService(getName(), true);
283+
int choreServiceInitialSize =
284+
conf.getInt(CHORE_SERVICE_INITIAL_POOL_SIZE, DEFAULT_CHORE_SERVICE_INITIAL_POOL_SIZE);
285+
this.choreService = new ChoreService(getName(), choreServiceInitialSize, true);
282286
this.executorService = new ExecutorService(getName());
283287

284288
this.metaRegionLocationCache = new MetaRegionLocationCache(zooKeeper);

0 commit comments

Comments
 (0)