@SuppressWarnings("deprecation")
  static Path getRegionSplitEditsPath(TableName tableName, byte[] encodedRegionName, long seqId,
    String fileNameBeingSplit, String tmpDirName, Configuration conf) throws IOException {
    FileSystem walFS = CommonFSUtils.getWALFileSystem(conf);
    Path tableDir = CommonFSUtils.getWALTableDir(conf, tableName);
    String encodedRegionNameStr = Bytes.toString(encodedRegionName);
    Path regionDir = HRegion.getRegionDir(tableDir, encodedRegionNameStr);
    Path dir = getRegionDirRecoveredEditsDir(regionDir);

    if (walFS.exists(dir) && walFS.isFile(dir)) {
      Path tmp = new Path(tmpDirName);
      if (!walFS.exists(tmp)) {
        walFS.mkdirs(tmp);
      }
      tmp = new Path(tmp, HConstants.RECOVERED_EDITS_DIR + "_" + encodedRegionNameStr);
      LOG.warn("Found existing old file: {}. It could be some "
        + "leftover of an old installation. It should be a folder instead. " + "So moving it to {}",
        dir, tmp);
      if (!walFS.rename(dir, tmp)) {
        LOG.warn("Failed to sideline old file {}", dir);
      }
    }

    if (!walFS.exists(dir) && !walFS.mkdirs(dir)) {
      LOG.warn("mkdir failed on {}", dir);
    } else {
      String storagePolicy =
        conf.get(HConstants.WAL_STORAGE_POLICY, HConstants.DEFAULT_WAL_STORAGE_POLICY);
      CommonFSUtils.setStoragePolicy(walFS, dir, storagePolicy);
    }
    // Append fileBeingSplit to prevent name conflict since we may have duplicate wal entries now.
    // Append file name ends with RECOVERED_LOG_TMPFILE_SUFFIX to ensure
    // region's replayRecoveredEdits will not delete it
    String fileName = formatRecoveredEditsFileName(seqId);
    fileName = getTmpRecoveredEditsFileName(fileName + "-" + fileNameBeingSplit);
    return new Path(dir, fileName);
  }
Path to a file under RECOVERED_EDITS_DIR directory of the region found in <code>logEntry</code>
named for the sequenceid in the passed <code>logEntry</code>: e.g.
/hbase/some_table/2323432434/recovered.edits/2332. This method also ensures existence of
RECOVERED_EDITS_DIR under the region creating it if necessary. And also set storage policy for
RECOVERED_EDITS_DIR if WAL_STORAGE_POLICY is configured.
@param tableName          the table name
@param encodedRegionName  the encoded region name
@param seqId              the sequence id which used to generate file name
@param fileNameBeingSplit the file being split currently. Used to generate tmp file name.
@param tmpDirName         of the directory used to sideline old recovered edits file
@param conf               configuration
@return Path to file into which to dump split log edits.
hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALSplitUtil.java