From 796e1a48ac03c1496728e0f3e1860a70b90c6edd Mon Sep 17 00:00:00 2001 From: Robert Joseph Evans Date: Mon, 23 Apr 2012 19:38:28 +0000 Subject: [PATCH] MAPREDUCE-4190. Improve web UI for task attempts userlog link (Tom Graves via bobby) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1329398 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 4 ++++ .../mapreduce/v2/app/webapp/TaskPage.java | 23 +++++++++++-------- .../mapreduce/v2/hs/webapp/HsTaskPage.java | 12 ++++++---- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 0f48354858..4a4973c1b5 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -392,6 +392,10 @@ Release 0.23.3 - UNRELEASED MAPREDUCE-3947. yarn.app.mapreduce.am.resource.mb not documented (Devaraj K via bobby) + MAPREDUCE-4190. Improve web UI for task attempts userlog link (Tom Graves + via bobby) + + Release 0.23.2 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/TaskPage.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/TaskPage.java index 1e7917e812..69e114f25d 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/TaskPage.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/TaskPage.java @@ -66,7 +66,8 @@ protected void render(Block html) { th(".id", "Attempt"). th(".progress", "Progress"). th(".state", "State"). - th(".node", "node"). + th(".node", "Node"). + th(".logs", "Logs"). th(".tsh", "Started"). th(".tsh", "Finished"). th(".tsh", "Elapsed"). @@ -83,24 +84,28 @@ protected void render(Block html) { long finishTime = ta.getFinishTime(); long elapsed = ta.getElapsedTime(); String diag = ta.getNote() == null ? "" : ta.getNote(); - TD>>> nodeTd = tbody. - tr(). - td(".id", taid). - td(".progress", progress). - td(".state", ta.getState()).td(); + TR>> row = tbody.tr(); + TD>>> nodeTd = row. + td(".id", taid). + td(".progress", progress). + td(".state", ta.getState()).td(); if (nodeHttpAddr == null) { nodeTd._("N/A"); } else { nodeTd. a(".nodelink", url("http://", nodeHttpAddr), nodeHttpAddr); } + nodeTd._(); if (containerId != null) { String containerIdStr = ta.getAssignedContainerIdStr(); - nodeTd._(" "). + row.td(). a(".logslink", url("http://", nodeHttpAddr, "node", "containerlogs", - containerIdStr, app.getJob().getUserName()), "logs"); + containerIdStr, app.getJob().getUserName()), "logs")._(); + } else { + row.td()._("N/A")._(); } - nodeTd._(). + + row. td(".ts", Times.format(startTime)). td(".ts", Times.format(finishTime)). td(".dt", StringUtils.formatTime(elapsed)). diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsTaskPage.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsTaskPage.java index f7a46b69c7..5e4b701b30 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsTaskPage.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/webapp/HsTaskPage.java @@ -89,7 +89,8 @@ protected void render(Block html) { headRow. th(".id", "Attempt"). th(".state", "State"). - th(".node", "node"). + th(".node", "Node"). + th(".logs", "Logs"). th(".tsh", "Start Time"); if(type == TaskType.REDUCE) { @@ -144,10 +145,11 @@ protected void render(Block html) { _(taid)._().td(ta.getState().toString()).td().a(".nodelink", "http://"+ nodeHttpAddr, nodeRackName + "/" + nodeHttpAddr); - td._(" ").a(".logslink", - url("logs", nodeIdString, containerIdString, taid, app.getJob() - .getUserName()), "logs"); td._(); + row.td(). + a(".logslink", + url("logs", nodeIdString, containerIdString, taid, app.getJob() + .getUserName()), "logs")._(); row.td(). br().$title(String.valueOf(attemptStartTime))._(). @@ -195,6 +197,8 @@ protected void render(Block html) { $name("attempt_state").$value("State")._()._(). th().input("search_init").$type(InputType.text). $name("attempt_node").$value("Node")._()._(). + th().input("search_init").$type(InputType.text). + $name("attempt_node").$value("Logs")._()._(). th().input("search_init").$type(InputType.text). $name("attempt_start_time").$value("Start Time")._()._();