@Test
  public void testCorruptedFileGetsArchivedIfSkipErrors() throws IOException {
    conf.setBoolean(WALSplitter.SPLIT_SKIP_ERRORS_KEY, true);
    List<FaultyProtobufWALStreamReader.FailureType> failureTypes =
      Arrays.asList(FaultyProtobufWALStreamReader.FailureType.values()).stream()
        .filter(x -> x != FaultyProtobufWALStreamReader.FailureType.NONE)
        .collect(Collectors.toList());
    for (FaultyProtobufWALStreamReader.FailureType failureType : failureTypes) {
      final Set<String> walDirContents = splitCorruptWALs(failureType);
      final Set<String> archivedLogs = new HashSet<>();
      final StringBuilder archived = new StringBuilder("Archived logs in CORRUPTDIR:");
      for (FileStatus log : fs.listStatus(CORRUPTDIR)) {
        archived.append("\n\t").append(log.toString());
        archivedLogs.add(log.getPath().getName());
      }
      LOG.debug(archived.toString());
      assertEquals(failureType.name() + ": expected to find all of our wals corrupt.", archivedLogs,
        walDirContents);
    }
  }
@param expectedEntries -1 to not assert
@return the count across all regions
hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALSplit.java