private void executeFlush(HRegion region) throws IOException {
    if (!RegionReplicaUtil.isDefaultReplica(region.getRegionInfo())) {
      return;
    }
    // retry 5 times if we can not flush
    for (int i = 0; i < 5; i++) {
      FlushResult result = region.flush(true);
      if (result.getResult() != FlushResult.Result.CANNOT_FLUSH) {
        return;
      }
      Threads.sleep(1000);
    }
  }
Shut down the mini HBase cluster
hbase-testing-util/src/main/java/org/apache/hadoop/hbase/MiniHBaseCluster.java