code: public static TaskAttemptContext newTaskAttemptContext(
                              Configuration conf, TaskAttemptID taskAttemptId) {
      return (TaskAttemptContext)
          newInstance(TASK_CONTEXT_CONSTRUCTOR, conf, taskAttemptId);
    }
docs: Creates TaskAttempContext from a JobConf and jobId using the correct
  constructor for based on Hadoop version.