Skip to content

Commit 57309e6

Browse files
ajbozarthpraveen-kanamarlapudi
authored andcommitted
LIVY-353. Web UI: Added link to Spark UI for Sessions running on Yarn
PR moved from old repo cloudera/livy#327 [LIVY-353](https://issues.cloudera.org/browse/LIVY-353) Followup to cloudera/livy#319 adding a link to the Application Id that links to the Spark UI. The link is grabbed from session.appInfo.sparkUiUrl if it exists, otherwise no link is created. Screenshots With an appId without link (in this case before the UI is generated): ![no-link](https://cloud.githubusercontent.com/assets/13952758/25873597/0307dd40-34c4-11e7-9993-925cbf7c749b.png) With an appId link: ![link](https://cloud.githubusercontent.com/assets/13952758/25873599/0454c69a-34c4-11e7-85d2-31ebe993c5a3.png) What it links to: ![spark](https://cloud.githubusercontent.com/assets/13952758/25873602/05864318-34c4-11e7-8e2c-2222ef7f6116.png) Author: Alex Bozarth <ajbozart@us.ibm.com> Closes apache#4 from ajbozarth/ui-app-link.
1 parent 4cc5915 commit 57309e6

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

Diff for: server/src/main/resources/com/cloudera/livy/server/ui/static/all-sessions.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@
1616
* limitations under the License.
1717
*/
1818

19+
function appIdLink(session) {
20+
var appUiUrl = session.appInfo.sparkUiUrl;
21+
if (appUiUrl != null) {
22+
return '<a href="' + appUiUrl + '">' + session.appId + "</a>";
23+
} else {
24+
return session.appId;
25+
}
26+
}
27+
1928
function tdWrap(str) {
2029
return "<td>" + str + "</td>";
2130
}
@@ -25,7 +34,7 @@ function loadSessionsTable(sessions) {
2534
$("#interactive-sessions .sessions-table-body").append(
2635
"<tr>" +
2736
tdWrap(session.id) +
28-
tdWrap(session.appId) +
37+
tdWrap(appIdLink(session)) +
2938
tdWrap(session.owner) +
3039
tdWrap(session.proxyUser) +
3140
tdWrap(session.kind) +
@@ -40,7 +49,7 @@ function loadBatchesTable(sessions) {
4049
$("#batches .sessions-table-body").append(
4150
"<tr>" +
4251
tdWrap(session.id) +
43-
tdWrap(session.appId) +
52+
tdWrap(appIdLink(session)) +
4453
tdWrap(session.state) +
4554
"</tr>"
4655
);

Diff for: server/src/main/resources/com/cloudera/livy/server/ui/static/batches-table.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ <h4 id="batches-header" class="sessions-template">Batch Sessions</h4>
2222
<thead class="sessions-table-head">
2323
<tr>
2424
<th>Batch Id</th>
25-
<th>Application Id</th>
25+
<th>
26+
<span data-toggle="tooltip"
27+
title="Spark Application Id for this session.
28+
If available, links to Spark Application Web UI">
29+
Application Id
30+
</span>
31+
</th>
2632
<th>
2733
<span data-toggle="tooltip"
2834
title="Session State (not_started, starting, idle, busy,

Diff for: server/src/main/resources/com/cloudera/livy/server/ui/static/sessions-table.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ <h4 id="interactive-sessions-header" class="sessions-template">Interactive Sessi
2222
<thead class="sessions-table-head">
2323
<tr>
2424
<th>Session Id</th>
25-
<th>Application Id</th>
25+
<th>
26+
<span data-toggle="tooltip"
27+
title="Spark Application Id for this session.
28+
If available, links to Spark Application Web UI">
29+
Application Id
30+
</span>
31+
</th>
2632
<th>
2733
<span data-toggle="tooltip" title="Remote user who submitted this session">
2834
Owner

0 commit comments

Comments
 (0)