boolean closeWriters(boolean finalizeEdits) throws IOException {
    List<IOException> thrown = Lists.newArrayList();
    for (RecoveredEditsWriter writer : writers.values()) {
      closeCompletionService.submit(() -> {
        if (!finalizeEdits) {
          abortRecoveredEditsWriter(writer, thrown);
          LOG.trace("Aborted edits at {}", writer.path);
          return null;
        }
        Path dst = closeRecoveredEditsWriterAndFinalizeEdits(writer, thrown);
        LOG.trace("Closed {}", dst);
        splits.add(dst);
        return null;
      });
    }
    boolean progressFailed = false;
    try {
      for (int i = 0, n = this.writers.size(); i < n; i++) {
        Future<Void> future = closeCompletionService.take();
        future.get();
        if (!progressFailed && reporter != null && !reporter.progress()) {
          progressFailed = true;
        }
      }
    } catch (InterruptedException e) {
      IOException iie = new InterruptedIOException();
      iie.initCause(e);
      throw iie;
    } catch (ExecutionException e) {
      throw new IOException(e.getCause());
    } finally {
      closeThreadPool.shutdownNow();
    }
    if (!thrown.isEmpty()) {
      throw MultipleIOException.createIOException(thrown);
    }
    return !progressFailed;
  }
Close all the output streams.
@param finalizeEdits true in the successful close case, false when we don't want to rename and
                     finalize the temporary, possibly corrupted WAL files, such as when there
                     was a previous failure or exception. Please see HBASE-28569.
@return true when there is no error.
hbase-server/src/main/java/org/apache/hadoop/hbase/wal/RecoveredEditsOutputSink.java