MAPREDUCE-4017. Add jobname to jobsummary log (tgraves and Koji Noguchi via bobby)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1311972 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Joseph Evans 2012-04-10 20:36:09 +00:00
parent d9b740cb14
commit 2accda38a1
4 changed files with 17 additions and 1 deletions

View File

@ -298,6 +298,9 @@ Release 0.23.3 - UNRELEASED
MAPREDUCE-4099. ApplicationMaster may fail to remove staging directory MAPREDUCE-4099. ApplicationMaster may fail to remove staging directory
(Jason Lowe via bobby) (Jason Lowe via bobby)
MAPREDUCE-4017. Add jobname to jobsummary log (tgraves and Koji Noguchi
via bobby)
Release 0.23.2 - UNRELEASED Release 0.23.2 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -551,6 +551,7 @@ public class JobHistoryEventHandler extends AbstractService
summary.setUser(jse.getUserName()); summary.setUser(jse.getUserName());
summary.setQueue(jse.getJobQueueName()); summary.setQueue(jse.getJobQueueName());
summary.setJobSubmitTime(jse.getSubmitTime()); summary.setJobSubmitTime(jse.getSubmitTime());
summary.setJobName(jse.getJobName());
break; break;
case NORMALIZED_RESOURCE: case NORMALIZED_RESOURCE:
NormalizedResourceEvent normalizedResourceEvent = NormalizedResourceEvent normalizedResourceEvent =

View File

@ -45,6 +45,7 @@ public class JobSummary {
private long mapSlotSeconds; // TODO Not generated yet in MRV2 private long mapSlotSeconds; // TODO Not generated yet in MRV2
private long reduceSlotSeconds; // TODO Not generated yet MRV2 private long reduceSlotSeconds; // TODO Not generated yet MRV2
// private int clusterSlotCapacity; // private int clusterSlotCapacity;
private String jobName;
JobSummary() { JobSummary() {
} }
@ -185,6 +186,14 @@ public class JobSummary {
this.reduceSlotSeconds = reduceSlotSeconds; this.reduceSlotSeconds = reduceSlotSeconds;
} }
public String getJobName() {
return jobName;
}
public void setJobName(String jobName) {
this.jobName = jobName;
}
public String getJobSummaryString() { public String getJobSummaryString() {
SummaryBuilder summary = new SummaryBuilder() SummaryBuilder summary = new SummaryBuilder()
.add("jobId", jobId) .add("jobId", jobId)
@ -201,7 +210,8 @@ public class JobSummary {
.add("queue", queue) .add("queue", queue)
.add("status", jobStatus) .add("status", jobStatus)
.add("mapSlotSeconds", mapSlotSeconds) .add("mapSlotSeconds", mapSlotSeconds)
.add("reduceSlotSeconds", reduceSlotSeconds); .add("reduceSlotSeconds", reduceSlotSeconds)
.add("jobName", jobName);
return summary.toString(); return summary.toString();
} }

View File

@ -267,6 +267,8 @@ public class TestJobHistoryParsing {
Assert.assertEquals("JobId does not match", jobId.toString(), Assert.assertEquals("JobId does not match", jobId.toString(),
jobSummaryElements.get("jobId")); jobSummaryElements.get("jobId"));
Assert.assertEquals("JobName does not match", "test",
jobSummaryElements.get("jobName"));
Assert.assertTrue("submitTime should not be 0", Assert.assertTrue("submitTime should not be 0",
Long.parseLong(jobSummaryElements.get("submitTime")) != 0); Long.parseLong(jobSummaryElements.get("submitTime")) != 0);
Assert.assertTrue("launchTime should not be 0", Assert.assertTrue("launchTime should not be 0",