Skip to content

Commit

Permalink
LIVY-353. Web UI: Added link to Spark UI for Sessions running on Yarn
Browse files Browse the repository at this point in the history
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 <[email protected]>

Closes apache#4 from ajbozarth/ui-app-link.
  • Loading branch information
ajbozarth authored and jerryshao committed Jun 30, 2017
1 parent 257ccdf commit 9d08a58
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
* limitations under the License.
*/

function appIdLink(session) {
var appUiUrl = session.appInfo.sparkUiUrl;
if (appUiUrl != null) {
return '<a href="' + appUiUrl + '">' + session.appId + "</a>";
} else {
return session.appId;
}
}

function tdWrap(str) {
return "<td>" + str + "</td>";
}
Expand All @@ -25,7 +34,7 @@ function loadSessionsTable(sessions) {
$("#interactive-sessions .sessions-table-body").append(
"<tr>" +
tdWrap(session.id) +
tdWrap(session.appId) +
tdWrap(appIdLink(session)) +
tdWrap(session.owner) +
tdWrap(session.proxyUser) +
tdWrap(session.kind) +
Expand All @@ -40,7 +49,7 @@ function loadBatchesTable(sessions) {
$("#batches .sessions-table-body").append(
"<tr>" +
tdWrap(session.id) +
tdWrap(session.appId) +
tdWrap(appIdLink(session)) +
tdWrap(session.state) +
"</tr>"
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ <h4 id="batches-header" class="sessions-template">Batch Sessions</h4>
<thead class="sessions-table-head">
<tr>
<th>Batch Id</th>
<th>Application Id</th>
<th>
<span data-toggle="tooltip"
title="Spark Application Id for this session.
If available, links to Spark Application Web UI">
Application Id
</span>
</th>
<th>
<span data-toggle="tooltip"
title="Session State (not_started, starting, idle, busy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ <h4 id="interactive-sessions-header" class="sessions-template">Interactive Sessi
<thead class="sessions-table-head">
<tr>
<th>Session Id</th>
<th>Application Id</th>
<th>
<span data-toggle="tooltip"
title="Spark Application Id for this session.
If available, links to Spark Application Web UI">
Application Id
</span>
</th>
<th>
<span data-toggle="tooltip" title="Remote user who submitted this session">
Owner
Expand Down

0 comments on commit 9d08a58

Please sign in to comment.