@Test
  public void testFlushWithRegionReplicas() throws Exception {
    TableDescriptor htd =
      TableDescriptorBuilder.newBuilder(tableName).setRegionReplication(2).build();
    TEST_UTIL.createTable(htd, new byte[][] { family }, null);

    // load the table
    for (int i = 0; i < blockingStoreFiles + 1; i++) {
      TEST_UTIL.loadTable(TEST_UTIL.getConnection().getTable(tableName), family);
      TEST_UTIL.flush(tableName);
    }

    // One region split should have taken place, because the primary replica gets split, and not the
    // secondary replica.
    assertEquals(1, TEST_UTIL.getRSForFirstRegionInTable(tableName).getCompactSplitThread()
      .getSubmittedSplitsCount());
  }
Setup the config for the cluster
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactSplitThread.java