@Test
  public void testThreadPoolSizeTuning() throws Exception {
    Configuration conf = TEST_UTIL.getConfiguration();
    Connection conn = ConnectionFactory.createConnection(conf);
    try {
      TableDescriptor tableDescriptor = TableDescriptorBuilder.newBuilder(tableName)
        .setColumnFamily(ColumnFamilyDescriptorBuilder.of(family)).setCompactionEnabled(false)
        .build();
      TEST_UTIL.getAdmin().createTable(tableDescriptor);
      TEST_UTIL.waitTableAvailable(tableName);
      HRegionServer regionServer = TEST_UTIL.getRSForFirstRegionInTable(tableName);

      // check initial configuration of thread pool sizes
      assertEquals(3, regionServer.getCompactSplitThread().getLargeCompactionThreadNum());
      assertEquals(4, regionServer.getCompactSplitThread().getSmallCompactionThreadNum());
      assertEquals(5, regionServer.getCompactSplitThread().getSplitThreadNum());

      // change bigger configurations and do online update
      conf.setInt(CompactSplit.LARGE_COMPACTION_THREADS, 4);
      conf.setInt(CompactSplit.SMALL_COMPACTION_THREADS, 5);
      conf.setInt(CompactSplit.SPLIT_THREADS, 6);
      try {
        regionServer.getCompactSplitThread().onConfigurationChange(conf);
      } catch (IllegalArgumentException iae) {
        Assert.fail("Update bigger configuration failed!");
      }

      // check again after online update
      assertEquals(4, regionServer.getCompactSplitThread().getLargeCompactionThreadNum());
      assertEquals(5, regionServer.getCompactSplitThread().getSmallCompactionThreadNum());
      assertEquals(6, regionServer.getCompactSplitThread().getSplitThreadNum());

      // change smaller configurations and do online update
      conf.setInt(CompactSplit.LARGE_COMPACTION_THREADS, 2);
      conf.setInt(CompactSplit.SMALL_COMPACTION_THREADS, 3);
      conf.setInt(CompactSplit.SPLIT_THREADS, 4);
      try {
        regionServer.getCompactSplitThread().onConfigurationChange(conf);
      } catch (IllegalArgumentException iae) {
        Assert.fail("Update smaller configuration failed!");
      }

      // check again after online update
      assertEquals(2, regionServer.getCompactSplitThread().getLargeCompactionThreadNum());
      assertEquals(3, regionServer.getCompactSplitThread().getSmallCompactionThreadNum());
      assertEquals(4, regionServer.getCompactSplitThread().getSplitThreadNum());
    } finally {
      conn.close();
    }
  }
Setup the config for the cluster
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactSplitThread.java