code: protected Optional<Dataset> createJobProps(Dataset dataset) throws IOException {
      if (this.recompactFromOutputPaths && (!latePathsFound(dataset))) {
        LOG.info(String.format("Skipping recompaction for %s since there is no late data in %s",
            new Object[] { dataset.inputPaths(), dataset.inputLatePaths() }));
        return Optional.absent();
      }
  
      State jobProps = new State();
      jobProps.addAll(this.state);
      jobProps.setProp(MRCompactor.COMPACTION_ENABLE_SUCCESS_FILE, false);
      jobProps.setProp(MRCompactor.COMPACTION_INPUT_DEDUPLICATED, this.inputDeduplicated);
      jobProps.setProp(MRCompactor.COMPACTION_OUTPUT_DEDUPLICATED, this.outputDeduplicated);
      jobProps.setProp(MRCompactor.COMPACTION_SHOULD_DEDUPLICATE, !this.inputDeduplicated && this.outputDeduplicated);
  
      if (this.recompactFromOutputPaths || !MRCompactor.datasetAlreadyCompacted(this.fs, dataset, renameSourceDirEnabled)) {
        if (renameSourceDirEnabled) {
          Set<Path> newUnrenamedDirs = MRCompactor.getDeepestLevelUnrenamedDirsWithFileExistence(this.fs, dataset.inputPaths());
          if (getAllFilePathsRecursively(newUnrenamedDirs).isEmpty()) {
            return Optional.absent();
          }
          LOG.info ("[{}] has unprocessed directories for first time compaction: {}", dataset.getDatasetName(), newUnrenamedDirs);
          dataset.overwriteInputPaths(newUnrenamedDirs);
          dataset.setRenamePaths(newUnrenamedDirs);
        } else {
          addInputLateFilesForFirstTimeCompaction(jobProps, dataset);
        }
  
        LOG.info(String.format("Created MR job properties for input %s and output %s.", dataset.inputPaths(),
                dataset.outputPath()));
        dataset.setJobProps(jobProps);
        return Optional.of(dataset);
      } else {
        return obtainDatasetWithJobProps (jobProps, dataset);
      }
    }
docs: Create MR job properties for a {@link Dataset}.