MAPREDUCE-3506. Calling getPriority on JobInfo after parsing a history log with JobHistoryParser throws a NullPointerException (Jason Lowe via bobby)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1375602 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Joseph Evans 2012-08-21 15:20:21 +00:00
parent f2dd818201
commit 0c2887b617
3 changed files with 24 additions and 5 deletions

View File

@ -818,6 +818,9 @@ Release 0.23.3 - UNRELEASED
MAPREDUCE-4053. Counters group names deprecation is wrong, iterating over MAPREDUCE-4053. Counters group names deprecation is wrong, iterating over
group names deprecated names don't show up (Robert Evans via tgraves) group names deprecated names don't show up (Robert Evans via tgraves)
MAPREDUCE-3506. Calling getPriority on JobInfo after parsing a history log
with JobHistoryParser throws a NullPointerException (Jason Lowe via bobby)
Release 0.23.2 - UNRELEASED Release 0.23.2 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -441,6 +441,7 @@ public class JobHistoryParser {
username = jobname = jobConfPath = jobQueueName = ""; username = jobname = jobConfPath = jobQueueName = "";
tasksMap = new HashMap<TaskID, TaskInfo>(); tasksMap = new HashMap<TaskID, TaskInfo>();
jobACLs = new HashMap<JobACL, AccessControlList>(); jobACLs = new HashMap<JobACL, AccessControlList>();
priority = JobPriority.NORMAL;
} }
/** Print all the job information */ /** Print all the job information */
@ -454,12 +455,20 @@ public class JobHistoryParser {
System.out.println("PRIORITY: " + priority); System.out.println("PRIORITY: " + priority);
System.out.println("TOTAL_MAPS: " + totalMaps); System.out.println("TOTAL_MAPS: " + totalMaps);
System.out.println("TOTAL_REDUCES: " + totalReduces); System.out.println("TOTAL_REDUCES: " + totalReduces);
System.out.println("MAP_COUNTERS:" + mapCounters.toString()); if (mapCounters != null) {
System.out.println("REDUCE_COUNTERS:" + reduceCounters.toString()); System.out.println("MAP_COUNTERS:" + mapCounters.toString());
System.out.println("TOTAL_COUNTERS: " + totalCounters.toString()); }
if (reduceCounters != null) {
System.out.println("REDUCE_COUNTERS:" + reduceCounters.toString());
}
if (totalCounters != null) {
System.out.println("TOTAL_COUNTERS: " + totalCounters.toString());
}
System.out.println("UBERIZED: " + uberized); System.out.println("UBERIZED: " + uberized);
for (AMInfo amInfo : amInfos) { if (amInfos != null) {
amInfo.printAll(); for (AMInfo amInfo : amInfos) {
amInfo.printAll();
}
} }
for (TaskInfo ti: tasksMap.values()) { for (TaskInfo ti: tasksMap.values()) {
ti.printAll(); ti.printAll();

View File

@ -83,6 +83,13 @@ public class TestJobHistoryParsing {
} }
} }
@Test
public void testJobInfo() throws Exception {
JobInfo info = new JobInfo();
Assert.assertEquals("NORMAL", info.getPriority());
info.printAll();
}
@Test @Test
public void testHistoryParsing() throws Exception { public void testHistoryParsing() throws Exception {
LOG.info("STARTING testHistoryParsing()"); LOG.info("STARTING testHistoryParsing()");