code: public static List<Path> getGoodFiles(Job job, Path tmpPath, FileSystem fs, List<String> acceptableExtension)
        throws IOException {
      List<TaskCompletionEvent> failedEvents = getUnsuccessfulTaskCompletionEvent(job);
  
      List<Path> allFilePaths = DatasetHelper.getApplicableFilePaths(fs, tmpPath, acceptableExtension);
      List<Path> goodPaths = new ArrayList<>();
      for (Path filePath : allFilePaths) {
        if (isFailedPath(filePath, failedEvents)) {
          fs.delete(filePath, false);
          log.error("{} is a bad path so it was deleted", filePath);
        } else {
          goodPaths.add(filePath);
        }
      }
  
      return goodPaths;
    }
docs: Get good files
  The problem happens when speculative task attempt initialized but then killed in the middle of processing.
  Some partial file was generated at {tmp_output}/_temporary/1/_temporary/attempt_xxx_xxx/xxxx(Avro file
  might have .avro as extension file name), without being committed to its final destination
  at {tmp_output}/xxxx.
  
  @param job Completed MR job
  @param fs File system that can handle file system
  @param acceptableExtension file extension acceptable as "good files".
  @return all successful files that has been committed