protected RecoveredEditsWriter createRecoveredEditsWriter(TableName tableName, byte[] region,
    long seqId) throws IOException {
    Path regionEditsPath = getRegionSplitEditsPath(tableName, region, seqId,
      walSplitter.getFileBeingSplit().getPath().getName(), walSplitter.getTmpDirName(),
      walSplitter.conf);
    if (walSplitter.walFS.exists(regionEditsPath)) {
      LOG.warn("Found old edits file. It could be the "
        + "result of a previous failed split attempt. Deleting " + regionEditsPath + ", length="
        + walSplitter.walFS.getFileStatus(regionEditsPath).getLen());
      if (!walSplitter.walFS.delete(regionEditsPath, false)) {
        LOG.warn("Failed delete of old {}", regionEditsPath);
      }
    }
    WALProvider.Writer w = walSplitter.createWriter(regionEditsPath);
    final String msg = "Creating recovered edits writer path=" + regionEditsPath;
    LOG.info(msg);
    updateStatusWithMsg(msg);
    return new RecoveredEditsWriter(region, regionEditsPath, w, seqId);
  }
Returns a writer that wraps a {@link WALProvider.Writer} and its Path. Caller should close.
hbase-server/src/main/java/org/apache/hadoop/hbase/wal/AbstractRecoveredEditsOutputSink.java