diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index d5993698def..9686d887692 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -52,6 +52,10 @@ Trunk (unreleased changes) BUG FIXES + MAPREDUCE-3953. [Gridmix] Gridmix throws NPE and does not simulate a + job if the trace contains null taskStatus for a task. + (ravigummadi) + MAPREDUCE-3829. [Gridmix] Gridmix should give better error message when input data directory already exists and -generate opton is given.(ravigummadi) diff --git a/hadoop-mapreduce-project/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/JobFactory.java b/hadoop-mapreduce-project/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/JobFactory.java index f5404e842ff..427174295c8 100644 --- a/hadoop-mapreduce-project/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/JobFactory.java +++ b/hadoop-mapreduce-project/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/JobFactory.java @@ -215,7 +215,13 @@ abstract class JobFactory implements Gridmix.Component,StatListener return null == job ? null : new FilterJobStory(job) { @Override public TaskInfo getTaskInfo(TaskType taskType, int taskNumber) { - return new MinTaskInfo(this.job.getTaskInfo(taskType, taskNumber)); + TaskInfo info = this.job.getTaskInfo(taskType, taskNumber); + if (info != null) { + info = new MinTaskInfo(info); + } else { + info = new MinTaskInfo(new TaskInfo(0, 0, 0, 0, 0)); + } + return info; } }; } diff --git a/hadoop-tools/hadoop-rumen/src/main/java/org/apache/hadoop/tools/rumen/ZombieJob.java b/hadoop-tools/hadoop-rumen/src/main/java/org/apache/hadoop/tools/rumen/ZombieJob.java index fa9378cad46..3857e1fea90 100644 --- a/hadoop-tools/hadoop-rumen/src/main/java/org/apache/hadoop/tools/rumen/ZombieJob.java +++ b/hadoop-tools/hadoop-rumen/src/main/java/org/apache/hadoop/tools/rumen/ZombieJob.java @@ -638,6 +638,9 @@ public class ZombieJob implements JobStory { } private TaskInfo getTaskInfo(LoggedTask loggedTask) { + if (loggedTask == null) { + return new TaskInfo(0, 0, 0, 0, 0); + } List attempts = loggedTask.getAttempts(); long inputBytes = -1;