private Path findRenamePath() {
    Path renamedPath;
    int i = 0;
    do {
      String suffix = i == 0 ? RENAME_SUFFIX : i + RENAME_SUFFIX;
      renamedPath = Paths.get(getManager().getFileName() + suffix);
      i++;
    } while (Files.exists(renamedPath));
    return renamedPath;
  }
Returns an available path to rename the current file.

It avoids the case where the file exists already in the current directory that would lead to the logger 
failing miserably.
llap-server/src/java/org/apache/hadoop/hive/llap/log/LlapRandomAccessFileAppender.java