Repository: hadoop
Updated Branches:
  refs/heads/branch-2 48be0ff67 -> 51e06c085


MAPREDUCE-6701. application master log can not be available when clicking 
jobhistory's am logs link. Contributed by Haibo Chen
(cherry picked from commit 12fa4ec141f8d0cb105b6f60c3739a4b26890fd5)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/51e06c08
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/51e06c08
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/51e06c08

Branch: refs/heads/branch-2
Commit: 51e06c085f38652587110adc4ce1dbf727d397c2
Parents: 48be0ff
Author: Jason Lowe <jl...@apache.org>
Authored: Tue May 17 14:54:13 2016 +0000
Committer: Jason Lowe <jl...@apache.org>
Committed: Tue May 17 14:56:23 2016 +0000

----------------------------------------------------------------------
 .../hadoop/mapreduce/v2/hs/webapp/HsJobBlock.java       |  2 +-
 .../mapreduce/v2/hs/webapp/dao/AMAttemptInfo.java       |  2 +-
 .../mapreduce/v2/hs/webapp/TestHsWebServicesJobs.java   | 12 +++++++-----
 3 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/51e06c08/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsJobBlock.java
----------------------------------------------------------------------
diff --git 
a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsJobBlock.java
 
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsJobBlock.java
index ddac853..13774a8 100644
--- 
a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsJobBlock.java
+++ 
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsJobBlock.java
@@ -142,7 +142,7 @@ public class HsJobBlock extends HtmlBlock {
               td().a(".nodelink", url(MRWebAppUtil.getYARNWebappScheme(),
                   attempt.getNodeHttpAddress()),
                   attempt.getNodeHttpAddress())._().
-              td().a(".logslink", url(attempt.getShortLogsLink()), 
+              td().a(".logslink", url(attempt.getLogsLink()),
                       "logs")._().
             _();
           }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/51e06c08/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/dao/AMAttemptInfo.java
----------------------------------------------------------------------
diff --git 
a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/dao/AMAttemptInfo.java
 
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/dao/AMAttemptInfo.java
index 065f8c7..54383df 100644
--- 
a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/dao/AMAttemptInfo.java
+++ 
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/dao/AMAttemptInfo.java
@@ -68,7 +68,7 @@ public class AMAttemptInfo {
     if (containerId != null) {
       this.containerId = containerId.toString();
       this.logsLink = join(host, pathPrefix,
-          ujoin("logs", this.nodeHttpAddress, this.containerId, jobId, user));
+          ujoin("logs", this.nodeId, this.containerId, jobId, user));
       this.shortLogsLink = ujoin("logs", this.nodeHttpAddress, 
this.containerId,
           jobId, user);
     }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/51e06c08/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/webapp/TestHsWebServicesJobs.java
----------------------------------------------------------------------
diff --git 
a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/webapp/TestHsWebServicesJobs.java
 
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/webapp/TestHsWebServicesJobs.java
index fc67c1f..4c4088f 100644
--- 
a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/webapp/TestHsWebServicesJobs.java
+++ 
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/webapp/TestHsWebServicesJobs.java
@@ -766,6 +766,7 @@ public class TestHsWebServicesJobs extends JerseyTest {
     for (int i = 0; i < attempts.length(); i++) {
       JSONObject attempt = attempts.getJSONObject(i);
       verifyHsJobAttemptsGeneric(job, attempt.getString("nodeHttpAddress"),
+          attempt.getString("nodeId"),
           attempt.getInt("id"),
           attempt.getLong("startTime"), attempt.getString("containerId"),
           attempt.getString("logsLink"));
@@ -779,6 +780,7 @@ public class TestHsWebServicesJobs extends JerseyTest {
       Element element = (Element) nodes.item(i);
       verifyHsJobAttemptsGeneric(job,
           WebServicesTestUtils.getXmlString(element, "nodeHttpAddress"),
+          WebServicesTestUtils.getXmlString(element, "nodeId"),
           WebServicesTestUtils.getXmlInt(element, "id"),
           WebServicesTestUtils.getXmlLong(element, "startTime"),
           WebServicesTestUtils.getXmlString(element, "containerId"),
@@ -787,7 +789,8 @@ public class TestHsWebServicesJobs extends JerseyTest {
   }
 
   public void verifyHsJobAttemptsGeneric(Job job, String nodeHttpAddress,
-      int id, long startTime, String containerId, String logsLink) {
+      String nodeId, int id, long startTime, String containerId,
+      String logsLink) {
     boolean attemptFound = false;
     for (AMInfo amInfo : job.getAMInfos()) {
       if (amInfo.getAppAttemptId().getAttemptId() == id) {
@@ -801,10 +804,9 @@ public class TestHsWebServicesJobs extends JerseyTest {
         WebServicesTestUtils.checkStringMatch("containerId", amInfo
             .getContainerId().toString(), containerId);
 
-        String localLogsLink = join(
-            "hsmockwebapp",
-            ujoin("logs", nodeHttpAddress, containerId,
-              MRApps.toString(job.getID()), job.getUserName()));
+        String localLogsLink = join("hsmockwebapp",
+            ujoin("logs", nodeId, containerId, MRApps.toString(job.getID()),
+                job.getUserName()));
 
         assertTrue("logsLink", logsLink.contains(localLogsLink));
       }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to