code: public void commitTask(TaskAttemptContext context) 
    throws IOException {
      TaskAttemptID attemptId = context.getTaskAttemptID();
      if (workPath != null) {
        context.progress();
        if (outputFileSystem.exists(workPath)) {
          // Move the task outputs to their final place
          moveTaskOutputs(context, outputFileSystem, outputPath, workPath);
          // Delete the temporary task-specific output directory
          if (!outputFileSystem.delete(workPath, true)) {
            LOG.warn("Failed to delete the temporary output" + 
            " directory of task: " + attemptId + " - " + workPath);
          }
          LOG.info("Saved output of task '" + attemptId + "' to " + 
                   outputPath);
        }
      }
    }
docs: Move the files from the work directory to the job output directory
  @param context the task context