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 .