parquet-hadoop/src/main/java/org/apache/parquet/hadoop/util/ContextUtil.java
public static TaskAttemptContext newTaskAttemptContext(
      Configuration conf, TaskAttemptID taskAttemptId) {
    try {
      return (TaskAttemptContext)
          TASK_CONTEXT_CONSTRUCTOR.newInstance(conf, taskAttemptId);
    } catch (InstantiationException e) {
      throw new IllegalArgumentException("Can't instantiate TaskAttemptContext", e);
    } catch (IllegalAccessException e) {
      throw new IllegalArgumentException("Can't instantiate TaskAttemptContext", e);
    } catch (InvocationTargetException e) {
      throw new IllegalArgumentException("Can't instantiate TaskAttemptContext", e);
    }
  }
public static TaskAttemptContext newTaskAttemptContext(
      Configuration conf, TaskAttemptID taskAttemptId) {
    try {
      return (TaskAttemptContext)
          TASK_CONTEXT_CONSTRUCTOR.newInstance(conf, taskAttemptId);
    } catch (InstantiationException e) {
      throw new IllegalArgumentException("Can't instantiate TaskAttemptContext", e);
    } catch (IllegalAccessException e) {
      throw new IllegalArgumentException("Can't instantiate TaskAttemptContext", e);
    } catch (InvocationTargetException e) {
      throw new IllegalArgumentException("Can't instantiate TaskAttemptContext", e);
    }
  }
Creates TaskAttemptContext from a JobConf and jobId using the correct
constructor for based on Hadoop version.

@param conf a configuration
@param taskAttemptId a task attempt id
@return a task attempt context