code: public Path constructLateFilePath(String originalFilename, FileSystem fs, Path outputDir) throws IOException {
      if (!fs.exists(new Path(outputDir, originalFilename))) {
        return new Path(outputDir, originalFilename);
      }
      return constructLateFilePath(FilenameUtils.getBaseName(originalFilename) + LATE_COMPONENT
          + new Random().nextInt(Integer.MAX_VALUE) + SEPARATOR + FilenameUtils.getExtension(originalFilename), fs,
          outputDir);
    }
docs: Construct filename for a late file. If the file does not exists in the output dir, retain the original name.
  Otherwise, append a LATE_COMPONENT{RandomInteger} to the original file name.
  For example, if file "part1.123.avro" exists in dir "/a/b/", the returned path will be "/a/b/part1.123.late12345.avro".