MAPREDUCE-3953. [Gridmix] Gridmix throws NPE and does not simulate a job if the trace contains null taskStatus for a task. (ravigummadi via tgraves)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1461242 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Graves 2013-03-26 17:52:40 +00:00
parent 67b93ebb23
commit 288393399a
3 changed files with 14 additions and 1 deletions

View File

@ -83,6 +83,10 @@ Release 2.0.5-beta - UNRELEASED
MAPREDUCE-2722. [Gridmix] Gridmix simulated job's map's hdfsBytesRead
counter is wrong when compressed input is used.(ravigummadi via tgraves)
MAPREDUCE-3953. [Gridmix] Gridmix throws NPE and does not simulate a
job if the trace contains null taskStatus for a task. (ravigummadi via
tgraves)
Release 2.0.4-alpha - UNRELEASED

View File

@ -215,7 +215,13 @@ abstract class JobFactory<T> implements Gridmix.Component<Void>,StatListener<T>
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;
}
};
}

View File

@ -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<LoggedTaskAttempt> attempts = loggedTask.getAttempts();
long inputBytes = -1;