From d8cc8f54dd2e60b65c32e532dcfac336eab49b05 Mon Sep 17 00:00:00 2001 From: Gera Shegalov Date: Mon, 22 Jun 2015 14:23:22 -0700 Subject: [PATCH] MAPREDUCE-6408. Queue name and user name should be printed on the job page. (Siqi Li via gera) (cherry picked from commit 11ac84820746e43f1e7072e08f62ddf81713aeb2) --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../org/apache/hadoop/mapreduce/v2/app/webapp/JobBlock.java | 2 ++ .../apache/hadoop/mapreduce/v2/app/webapp/dao/JobInfo.java | 6 ++++++ .../mapreduce/v2/app/webapp/TestAMWebServicesJobs.java | 2 +- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 281114756a0..cc809ad6626 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -94,6 +94,9 @@ Release 2.8.0 - UNRELEASED MAPREDUCE-6305. AM/Task log page should be able to link back to the job. (Siqi Li via gera) + MAPREDUCE-6408. Queue name and user name should be printed on the job page. + (Siqi Li via gera) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/JobBlock.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/JobBlock.java index 0c6d7736fb1..a599870b451 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/JobBlock.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/JobBlock.java @@ -78,6 +78,8 @@ public class JobBlock extends HtmlBlock { JobInfo jinfo = new JobInfo(job, true); info("Job Overview"). _("Job Name:", jinfo.getName()). + _("User Name:", jinfo.getUserName()). + _("Queue Name:", jinfo.getQueueName()). _("State:", jinfo.getState()). _("Uberized:", jinfo.isUberized()). _("Started:", new Date(jinfo.getStartTime())). diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/dao/JobInfo.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/dao/JobInfo.java index d823cad4b99..ffb243be818 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/dao/JobInfo.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/dao/JobInfo.java @@ -51,6 +51,7 @@ public class JobInfo { protected String id; protected String name; protected String user; + protected String queue; protected JobState state; protected int mapsTotal; protected int mapsCompleted; @@ -97,6 +98,7 @@ public class JobInfo { } this.name = job.getName().toString(); this.user = job.getUserName(); + this.queue = job.getQueueName(); this.state = job.getState(); this.mapsTotal = job.getTotalMaps(); this.mapsCompleted = job.getCompletedMaps(); @@ -223,6 +225,10 @@ public class JobInfo { return this.name; } + public String getQueueName() { + return this.queue; + } + public String getId() { return this.id; } diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAMWebServicesJobs.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAMWebServicesJobs.java index 2783379a90d..a61e407ed2f 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAMWebServicesJobs.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/webapp/TestAMWebServicesJobs.java @@ -413,7 +413,7 @@ public class TestAMWebServicesJobs extends JerseyTest { public void verifyAMJob(JSONObject info, Job job) throws JSONException { - assertEquals("incorrect number of elements", 30, info.length()); + assertEquals("incorrect number of elements", 31, info.length()); // everyone access fields verifyAMJobGeneric(job, info.getString("id"), info.getString("user"),