Path getFlushedHFile(FileSystem fs, TableName table) throws IOException {
    Path tableDir = CommonFSUtils.getTableDir(CommonFSUtils.getRootDir(conf), table);
    Path regionDir = FSUtils.getRegionDirs(fs, tableDir).get(0);
    Path famDir = new Path(regionDir, FAM_STR);

    // keep doing this until we get a legit hfile
    while (true) {
      FileStatus[] hfFss = fs.listStatus(famDir);
      if (hfFss.length == 0) {
        continue;
      }
      for (FileStatus hfs : hfFss) {
        if (!hfs.isDirectory()) {
          return hfs.getPath();
        }
      }
    }
  }
We don't have an easy way to verify that a flush completed, so we loop until we find a
legitimate hfile and return it.
@return Path of a flushed hfile.
hbase-server/src/test/java/org/apache/hadoop/hbase/util/BaseTestHBaseFsck.java