This is an automated email from the ASF dual-hosted git repository.

jshao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-livy.git


The following commit(s) were added to refs/heads/master by this push:
     new c4bb55b  [LIVY-645] Add Session Name, Owner, Proxy User information to 
Web UI
c4bb55b is described below

commit c4bb55b12f5978ba151d92e1f1e655f91233138b
Author: Jeffrey(Xilang) Yan <7855100+yan...@users.noreply.github.com>
AuthorDate: Thu Sep 5 14:14:17 2019 +0800

    [LIVY-645] Add Session Name, Owner, Proxy User information to Web UI
    
    ## What changes were proposed in this pull request?
    
    1, Web UI, add Session Name to Interactive Sessions list
    2, Web UI, add Session Name, Owner, Proxy User to Batch Sessions list
    3,~~fix thrift server session doesn't set Session Name issue.~~ Move to PR 
#218
    
    ## How was this patch tested?
    
    Update existing unit test, and have tested manually.
    
    
![AddName](https://user-images.githubusercontent.com/7855100/63513238-3de7d000-c518-11e9-8b18-613874ed635a.jpg)
    
![AddName2](https://user-images.githubusercontent.com/7855100/63513246-42ac8400-c518-11e9-9019-679bb82e4bb0.jpg)
    
    Author: Jeffrey(Xilang) Yan <7855100+yan...@users.noreply.github.com>
    
    Closes #207 from yantzu/add_more_info_to_ui.
---
 .../apache/livy/server/ui/static/html/batches-table.html | 16 ++++++++++++++++
 .../livy/server/ui/static/html/sessions-table.html       |  6 ++++++
 .../org/apache/livy/server/ui/static/js/all-sessions.js  |  4 ++++
 .../org/apache/livy/server/ui/static/js/session.js       |  1 +
 .../apache/livy/server/batch/BatchSessionServlet.scala   |  6 ++++--
 .../org/apache/livy/server/batch/BatchServletSpec.scala  |  7 ++++++-
 6 files changed, 37 insertions(+), 3 deletions(-)

diff --git 
a/server/src/main/resources/org/apache/livy/server/ui/static/html/batches-table.html
 
b/server/src/main/resources/org/apache/livy/server/ui/static/html/batches-table.html
index aeab23b..b198e98 100644
--- 
a/server/src/main/resources/org/apache/livy/server/ui/static/html/batches-table.html
+++ 
b/server/src/main/resources/org/apache/livy/server/ui/static/html/batches-table.html
@@ -35,6 +35,22 @@
     </th>
     <th>
       <span data-toggle="tooltip"
+            title="Application name for this session.">
+        Name
+      </span>
+    </th>
+    <th>
+      <span data-toggle="tooltip" title="Remote user who submitted this 
session">
+        Owner
+      </span>
+    </th>
+    <th>
+      <span data-toggle="tooltip" title="User to impersonate when running">
+        Proxy User
+      </span>
+    </th>
+    <th>
+      <span data-toggle="tooltip"
             title="Session State (not_started, starting, idle, busy,
             shutting_down, error, dead, success)">
         State
diff --git 
a/server/src/main/resources/org/apache/livy/server/ui/static/html/sessions-table.html
 
b/server/src/main/resources/org/apache/livy/server/ui/static/html/sessions-table.html
index 8c64100..d832e07 100644
--- 
a/server/src/main/resources/org/apache/livy/server/ui/static/html/sessions-table.html
+++ 
b/server/src/main/resources/org/apache/livy/server/ui/static/html/sessions-table.html
@@ -35,6 +35,12 @@
       </span>
     </th>
     <th>
+      <span data-toggle="tooltip"
+            title="Application name for this session.">
+        Name
+      </span>
+    </th>
+    <th>
       <span data-toggle="tooltip" title="Remote user who submitted this 
session">
         Owner
       </span>
diff --git 
a/server/src/main/resources/org/apache/livy/server/ui/static/js/all-sessions.js 
b/server/src/main/resources/org/apache/livy/server/ui/static/js/all-sessions.js
index 90de331..6e35702 100644
--- 
a/server/src/main/resources/org/apache/livy/server/ui/static/js/all-sessions.js
+++ 
b/server/src/main/resources/org/apache/livy/server/ui/static/js/all-sessions.js
@@ -21,6 +21,7 @@ function loadSessionsTable(sessions) {
       "<tr>" +
         tdWrap(uiLink("session/" + session.id, session.id)) +
         tdWrap(appIdLink(session)) +
+        tdWrap(session.name) +
         tdWrap(session.owner) +
         tdWrap(session.proxyUser) +
         tdWrap(session.kind) +
@@ -37,6 +38,9 @@ function loadBatchesTable(sessions) {
       "<tr>" +
         tdWrap(session.id) +
         tdWrap(appIdLink(session)) +
+        tdWrap(session.name) +
+        tdWrap(session.owner) +
+        tdWrap(session.proxyUser) +
         tdWrap(session.state) +
         tdWrap(logLinks(session, "batch")) +
         "</tr>"
diff --git 
a/server/src/main/resources/org/apache/livy/server/ui/static/js/session.js 
b/server/src/main/resources/org/apache/livy/server/ui/static/js/session.js
index d49e0ec..c87e5ca 100644
--- a/server/src/main/resources/org/apache/livy/server/ui/static/js/session.js
+++ b/server/src/main/resources/org/apache/livy/server/ui/static/js/session.js
@@ -88,6 +88,7 @@ function appendSummary(session) {
     "<h3>Session " + session.id + "</h3>" +
     "<ul class='list-unstyled'>" +
       sumWrap("Application Id", appIdLink(session)) +
+      sumWrap("Name", session.name) +
       sumWrap("Owner", session.owner) +
       sumWrap("Proxy User", session.proxyUser) +
       sumWrap("Session Kind", session.kind) +
diff --git 
a/server/src/main/scala/org/apache/livy/server/batch/BatchSessionServlet.scala 
b/server/src/main/scala/org/apache/livy/server/batch/BatchSessionServlet.scala
index 0bf6799..d14e649 100644
--- 
a/server/src/main/scala/org/apache/livy/server/batch/BatchSessionServlet.scala
+++ 
b/server/src/main/scala/org/apache/livy/server/batch/BatchSessionServlet.scala
@@ -28,6 +28,8 @@ import org.apache.livy.utils.AppInfo
 case class BatchSessionView(
   id: Long,
   name: Option[String],
+  owner: String,
+  proxyUser: Option[String],
   state: String,
   appId: Option[String],
   appInfo: AppInfo,
@@ -73,8 +75,8 @@ class BatchSessionServlet(
       } else {
         Nil
       }
-    BatchSessionView(session.id, session.name, session.state.toString, 
session.appId,
-      session.appInfo, logs)
+    BatchSessionView(session.id, session.name, session.owner, 
session.proxyUser,
+      session.state.toString, session.appId, session.appInfo, logs)
   }
 
 }
diff --git 
a/server/src/test/scala/org/apache/livy/server/batch/BatchServletSpec.scala 
b/server/src/test/scala/org/apache/livy/server/batch/BatchServletSpec.scala
index 9920586..1999caa 100644
--- a/server/src/test/scala/org/apache/livy/server/batch/BatchServletSpec.scala
+++ b/server/src/test/scala/org/apache/livy/server/batch/BatchServletSpec.scala
@@ -66,6 +66,8 @@ class BatchServletSpec extends 
BaseSessionServletSpec[BatchSession, BatchRecover
     val id = 0
     val state = SessionState.Running
     val appId = "appid"
+    val owner = "owner"
+    val proxyUser = "proxyUser"
     val appInfo = AppInfo(Some("DRIVER LOG URL"), Some("SPARK UI URL"))
     val log = IndexedSeq[String]("log1", "log2")
 
@@ -76,7 +78,8 @@ class BatchServletSpec extends 
BaseSessionServletSpec[BatchSession, BatchRecover
     when(session.appId).thenReturn(Some(appId))
     when(session.appInfo).thenReturn(appInfo)
     when(session.logLines()).thenReturn(log)
-    when(session.proxyUser).thenReturn(None)
+    when(session.owner).thenReturn(owner)
+    when(session.proxyUser).thenReturn(Some(proxyUser))
 
     val req = mock[HttpServletRequest]
 
@@ -87,6 +90,8 @@ class BatchServletSpec extends 
BaseSessionServletSpec[BatchSession, BatchRecover
     view.name shouldEqual name
     view.state shouldEqual state.toString
     view.appId shouldEqual Some(appId)
+    view.owner shouldEqual owner
+    view.proxyUser shouldEqual Some(proxyUser)
     view.appInfo shouldEqual appInfo
     view.log shouldEqual log
   }

Reply via email to