private int getScannedCount(RegionScanner scanner) throws IOException {
    int scannedCount = 0;
    List<Cell> results = new ArrayList<>();
    while (true) {
      boolean existMore = scanner.next(results);
      if (!results.isEmpty()) {
        scannedCount++;
      }
      if (!existMore) {
        break;
      }
      results.clear();
    }
    return scannedCount;
  }
Test that we could recover the data correctly after aborting flush. In the test, first we abort
flush after writing some data, then writing more data and flush again, at last verify the data.
hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALSplitToHFile.java