Skip to content

Commit

Permalink
HBASE-27565 Make the initial corePoolSize configurable for ChoreServi…
Browse files Browse the repository at this point in the history
…ce (#4958)

Signed-off-by: Duo Zhang <[email protected]>
  • Loading branch information
petersomogyi committed Jan 12, 2023
1 parent 56ebf93 commit 4902c08
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ public class ChoreService {
*/
@InterfaceAudience.Private
public final static int MIN_CORE_POOL_SIZE = 1;
/**
* The initial number of threads in the core pool for the {@link ChoreService}.
*/
public static final String CHORE_SERVICE_INITIAL_POOL_SIZE =
"hbase.choreservice.initial.pool.size";
public static final int DEFAULT_CHORE_SERVICE_INITIAL_POOL_SIZE = 1;

/**
* This thread pool is used to schedule all of the Chores
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*/
package org.apache.hadoop.hbase.regionserver;

import static org.apache.hadoop.hbase.ChoreService.CHORE_SERVICE_INITIAL_POOL_SIZE;
import static org.apache.hadoop.hbase.ChoreService.DEFAULT_CHORE_SERVICE_INITIAL_POOL_SIZE;
import static org.apache.hadoop.hbase.HConstants.DEFAULT_HBASE_SPLIT_COORDINATED_BY_ZK;
import static org.apache.hadoop.hbase.HConstants.DEFAULT_HBASE_SPLIT_WAL_MAX_SPLITTER;
import static org.apache.hadoop.hbase.HConstants.HBASE_SPLIT_WAL_COORDINATED_BY_ZK;
Expand Down Expand Up @@ -681,7 +683,9 @@ public HRegionServer(final Configuration conf) throws IOException {
// and M (An M IS A HRS now). Need to refactor so less duplication between M and its super
// Master expects Constructor to put up web servers. Ugh.
// class HRS. TODO.
this.choreService = new ChoreService(getName(), true);
int choreServiceInitialSize =
conf.getInt(CHORE_SERVICE_INITIAL_POOL_SIZE, DEFAULT_CHORE_SERVICE_INITIAL_POOL_SIZE);
this.choreService = new ChoreService(getName(), choreServiceInitialSize, true);
this.executorService = new ExecutorService(getName());
putUpWebUI();
} catch (Throwable t) {
Expand Down

0 comments on commit 4902c08

Please sign in to comment.