/** * test TaskAttemptID */ @SuppressWarnings( "deprecation" ) @Test (timeout=5000) public void testTaskAttemptID (){ TaskAttemptID task = new TaskAttemptID("001",2,true,3,4); assertEquals("attempt_001_0002_m_000003_4", TaskAttemptID.getTaskAttemptIDsPattern("001", 2, true, 3, 4)); assertEquals("task_001_0002_m_000003", task.getTaskID().toString()); assertEquals("attempt_001_0001_r_000002_3",TaskAttemptID.getTaskAttemptIDsPattern("001", 1, TaskType.REDUCE, 2, 3)); assertEquals("001_0001_m_000001_2", TaskAttemptID.getTaskAttemptIDsPatternWOPrefix("001",1, TaskType.MAP, 1, 2).toString()); }
/** * Returns a regex pattern which matches task attempt IDs. Arguments can * be given null, in which case that part of the regex will be generic. * For example to obtain a regex matching <i>all task attempt IDs</i> * of <i>any jobtracker</i>, in <i>any job</i>, of the <i>first * map task</i>, we would use : * <pre> * TaskAttemptID.getTaskAttemptIDsPattern(null, null, true, 1, null); * </pre> * which will return : * <pre> "attempt_[^_]*_[0-9]*_m_000001_[0-9]*" </pre> * @param jtIdentifier jobTracker identifier, or null * @param jobId job number, or null * @param isMap whether the tip is a map, or null * @param taskId taskId number, or null * @param attemptId the task attempt number, or null * @return a regex pattern matching TaskAttemptIDs */ @Deprecated public static String getTaskAttemptIDsPattern(String jtIdentifier, Integer jobId, Boolean isMap, Integer taskId, Integer attemptId) { return getTaskAttemptIDsPattern(jtIdentifier, jobId, isMap ? TaskType.MAP : TaskType.REDUCE, taskId, attemptId); }
/** * Returns a regex pattern which matches task attempt IDs. Arguments can * be given null, in which case that part of the regex will be generic. * For example to obtain a regex matching <i>all task attempt IDs</i> * of <i>any jobtracker</i>, in <i>any job</i>, of the <i>first * map task</i>, we would use : * <pre> * TaskAttemptID.getTaskAttemptIDsPattern(null, null, true, 1, null); * </pre> * which will return : * <pre> "attempt_[^_]*_[0-9]*_m_000001_[0-9]*" </pre> * @param jtIdentifier jobTracker identifier, or null * @param jobId job number, or null * @param isMap whether the tip is a map, or null * @param taskId taskId number, or null * @param attemptId the task attempt number, or null * @return a regex pattern matching TaskAttemptIDs */ @Deprecated public static String getTaskAttemptIDsPattern(String jtIdentifier, Integer jobId, Boolean isMap, Integer taskId, Integer attemptId) { return getTaskAttemptIDsPattern(jtIdentifier, jobId, isMap ? TaskType.MAP : TaskType.REDUCE, taskId, attemptId); }
/** * Returns a regex pattern which matches task attempt IDs. Arguments can * be given null, in which case that part of the regex will be generic. * For example to obtain a regex matching <i>all task attempt IDs</i> * of <i>any jobtracker</i>, in <i>any job</i>, of the <i>first * map task</i>, we would use : * <pre> * TaskAttemptID.getTaskAttemptIDsPattern(null, null, true, 1, null); * </pre> * which will return : * <pre> "attempt_[^_]*_[0-9]*_m_000001_[0-9]*" </pre> * @param jtIdentifier jobTracker identifier, or null * @param jobId job number, or null * @param isMap whether the tip is a map, or null * @param taskId taskId number, or null * @param attemptId the task attempt number, or null * @return a regex pattern matching TaskAttemptIDs */ @Deprecated public static String getTaskAttemptIDsPattern(String jtIdentifier, Integer jobId, Boolean isMap, Integer taskId, Integer attemptId) { return getTaskAttemptIDsPattern(jtIdentifier, jobId, isMap ? TaskType.MAP : TaskType.REDUCE, taskId, attemptId); }
/** * Returns a regex pattern which matches task attempt IDs. Arguments can * be given null, in which case that part of the regex will be generic. * For example to obtain a regex matching <i>all task attempt IDs</i> * of <i>any jobtracker</i>, in <i>any job</i>, of the <i>first * map task</i>, we would use : * <pre> * TaskAttemptID.getTaskAttemptIDsPattern(null, null, true, 1, null); * </pre> * which will return : * <pre> "attempt_[^_]*_[0-9]*_m_000001_[0-9]*" </pre> * @param jtIdentifier jobTracker identifier, or null * @param jobId job number, or null * @param isMap whether the tip is a map, or null * @param taskId taskId number, or null * @param attemptId the task attempt number, or null * @return a regex pattern matching TaskAttemptIDs */ @Deprecated public static String getTaskAttemptIDsPattern(String jtIdentifier, Integer jobId, Boolean isMap, Integer taskId, Integer attemptId) { return getTaskAttemptIDsPattern(jtIdentifier, jobId, isMap ? TaskType.MAP : TaskType.REDUCE, taskId, attemptId); }
/** * Returns a regex pattern which matches task attempt IDs. Arguments can * be given null, in which case that part of the regex will be generic. * For example to obtain a regex matching <i>all task attempt IDs</i> * of <i>any jobtracker</i>, in <i>any job</i>, of the <i>first * map task</i>, we would use : * <pre> * TaskAttemptID.getTaskAttemptIDsPattern(null, null, true, 1, null); * </pre> * which will return : * <pre> "attempt_[^_]*_[0-9]*_m_000001_[0-9]*" </pre> * @param jtIdentifier jobTracker identifier, or null * @param jobId job number, or null * @param isMap whether the tip is a map, or null * @param taskId taskId number, or null * @param attemptId the task attempt number, or null * @return a regex pattern matching TaskAttemptIDs */ @Deprecated public static String getTaskAttemptIDsPattern(String jtIdentifier, Integer jobId, Boolean isMap, Integer taskId, Integer attemptId) { return getTaskAttemptIDsPattern(jtIdentifier, jobId, isMap ? TaskType.MAP : TaskType.REDUCE, taskId, attemptId); }
TaskAttemptID.getTaskAttemptIDsPattern(null, null, TaskType.MAP, 1, null); jobConf.setKeepTaskFilesPattern(pattern); TestResult result;
TaskAttemptID.getTaskAttemptIDsPattern(null, null, TaskType.MAP, 1, null); conf.setKeepTaskFilesPattern(pattern);