SummarizedJob Class Improvment

This commit is contained in:
zhangyubiao 2014-09-18 17:23:31 +08:00
parent 47e5e19831
commit bfcf11dbec
1 changed files with 21 additions and 22 deletions

View File

@ -602,7 +602,7 @@ public class HistoryViewer {
for (JobHistoryParser.TaskAttemptInfo attempt : attempts.values()) {
long startTime = attempt.getStartTime();
long finishTime = attempt.getFinishTime();
if (attempt.getTaskType().equals(TaskType.MAP)) {
if (TaskType.MAP.equals(attempt.getTaskType())) {
if (mapStarted== 0 || mapStarted > startTime) {
mapStarted = startTime;
}
@ -610,14 +610,13 @@ public class HistoryViewer {
mapFinished = finishTime;
}
totalMaps++;
if (attempt.getTaskStatus().equals
(TaskStatus.State.FAILED.toString())) {
if (TaskStatus.State.FAILED.toString().equals(attempt.getTaskStatus())) {
numFailedMaps++;
} else if (attempt.getTaskStatus().equals
(TaskStatus.State.KILLED.toString())) {
numKilledMaps++;
}
} else if (attempt.getTaskType().equals(TaskType.REDUCE)) {
} else if (TaskType.REDUCE.equals(attempt.getTaskType())) {
if (reduceStarted==0||reduceStarted > startTime) {
reduceStarted = startTime;
}
@ -625,14 +624,14 @@ public class HistoryViewer {
reduceFinished = finishTime;
}
totalReduces++;
if (attempt.getTaskStatus().equals
(TaskStatus.State.FAILED.toString())) {
if (TaskStatus.State.FAILED.toString().equals
(attempt.getTaskStatus())) {
numFailedReduces++;
} else if (attempt.getTaskStatus().equals
(TaskStatus.State.KILLED.toString())) {
} else if (TaskStatus.State.KILLED.toString().equals
(attempt.getTaskStatus())) {
numKilledReduces++;
}
} else if (attempt.getTaskType().equals(TaskType.JOB_CLEANUP)) {
} else if (TaskType.JOB_CLEANUP.equals(attempt.getTaskType())) {
if (cleanupStarted==0||cleanupStarted > startTime) {
cleanupStarted = startTime;
}
@ -640,17 +639,17 @@ public class HistoryViewer {
cleanupFinished = finishTime;
}
totalCleanups++;
if (attempt.getTaskStatus().equals
(TaskStatus.State.SUCCEEDED.toString())) {
if (TaskStatus.State.SUCCEEDED.toString().equals
(attempt.getTaskStatus())) {
numFinishedCleanups++;
} else if (attempt.getTaskStatus().equals
(TaskStatus.State.FAILED.toString())) {
} else if (TaskStatus.State.FAILED.toString().equals
(attempt.getTaskStatus())) {
numFailedCleanups++;
} else if (attempt.getTaskStatus().equals
(TaskStatus.State.KILLED.toString())) {
} else if (TaskStatus.State.KILLED.toString().equals
(attempt.getTaskStatus())) {
numKilledCleanups++;
}
} else if (attempt.getTaskType().equals(TaskType.JOB_SETUP)) {
} else if (TaskType.JOB_SETUP.equals(attempt.getTaskType())) {
if (setupStarted==0||setupStarted > startTime) {
setupStarted = startTime;
}
@ -658,14 +657,14 @@ public class HistoryViewer {
setupFinished = finishTime;
}
totalSetups++;
if (attempt.getTaskStatus().equals
(TaskStatus.State.SUCCEEDED.toString())) {
if (TaskStatus.State.SUCCEEDED.toString().equals
(attempt.getTaskStatus())) {
numFinishedSetups++;
} else if (attempt.getTaskStatus().equals
(TaskStatus.State.FAILED.toString())) {
} else if (TaskStatus.State.FAILED.toString().equals
(attempt.getTaskStatus())) {
numFailedSetups++;
} else if (attempt.getTaskStatus().equals
(TaskStatus.State.KILLED.toString())) {
} else if (TaskStatus.State.KILLED.toString().equals
(attempt.getTaskStatus())) {
numKilledSetups++;
}
}