simon824 commented on a change in pull request #1317:
URL: https://github.com/apache/incubator-kyuubi/pull/1317#discussion_r741559475



##########
File path: 
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/dto.scala
##########
@@ -32,6 +32,11 @@ case class SessionOverview(
   sessionHandle: SessionHandle
 )
 
+case class InfoValue(

Review comment:
       Make sense, updated to InfoDetail.

##########
File path: 
kyuubi-server/src/test/scala/org/apache/kyuubi/server/api/v1/SessionsResourceSuite.scala
##########
@@ -171,4 +171,26 @@ class SessionsResourceSuite extends KyuubiFunSuite {
         assert(404 == response.getStatus)
     }
   }
+
+  test("test get infoType") {
+    val requestObj = SessionOpenRequest(
+      1, "admin", "123456", "localhost", Map("testConfig" -> "testValue"))
+
+    RestFrontendServiceSuite.withKyuubiRestServer {
+      (_, _, _, webTarget) =>
+        var response: Response = webTarget.path("api/v1/sessions")
+          .request(MediaType.APPLICATION_JSON_TYPE)
+          .post(Entity.entity(requestObj, MediaType.APPLICATION_JSON_TYPE))
+
+        val sessionHandle = response.readEntity(classOf[SessionHandle])
+        val serializedSessionHandle = s"${sessionHandle.identifier.publicId}|" 
+
+          
s"${sessionHandle.identifier.secretId}|${sessionHandle.protocol.getValue}"
+
+        response = 
webTarget.path(s"api/v1/sessions/$serializedSessionHandle/info/13")

Review comment:
       OK

##########
File path: 
kyuubi-server/src/test/scala/org/apache/kyuubi/server/api/v1/SessionsResourceSuite.scala
##########
@@ -171,4 +171,26 @@ class SessionsResourceSuite extends KyuubiFunSuite {
         assert(404 == response.getStatus)
     }
   }
+
+  test("test get infoType") {
+    val requestObj = SessionOpenRequest(
+      1, "admin", "123456", "localhost", Map("testConfig" -> "testValue"))
+
+    RestFrontendServiceSuite.withKyuubiRestServer {
+      (_, _, _, webTarget) =>
+        var response: Response = webTarget.path("api/v1/sessions")
+          .request(MediaType.APPLICATION_JSON_TYPE)
+          .post(Entity.entity(requestObj, MediaType.APPLICATION_JSON_TYPE))
+
+        val sessionHandle = response.readEntity(classOf[SessionHandle])
+        val serializedSessionHandle = s"${sessionHandle.identifier.publicId}|" 
+
+          
s"${sessionHandle.identifier.secretId}|${sessionHandle.protocol.getValue}"
+
+        response = 
webTarget.path(s"api/v1/sessions/$serializedSessionHandle/info/13")

Review comment:
       Maybe we can define it in the document?  Because they are all immutable.

##########
File path: 
kyuubi-server/src/test/scala/org/apache/kyuubi/server/api/v1/SessionsResourceSuite.scala
##########
@@ -171,4 +171,26 @@ class SessionsResourceSuite extends KyuubiFunSuite {
         assert(404 == response.getStatus)
     }
   }
+
+  test("test get infoType") {
+    val requestObj = SessionOpenRequest(
+      1, "admin", "123456", "localhost", Map("testConfig" -> "testValue"))
+
+    RestFrontendServiceSuite.withKyuubiRestServer {
+      (_, _, _, webTarget) =>
+        var response: Response = webTarget.path("api/v1/sessions")
+          .request(MediaType.APPLICATION_JSON_TYPE)
+          .post(Entity.entity(requestObj, MediaType.APPLICATION_JSON_TYPE))
+
+        val sessionHandle = response.readEntity(classOf[SessionHandle])
+        val serializedSessionHandle = s"${sessionHandle.identifier.publicId}|" 
+
+          
s"${sessionHandle.identifier.secretId}|${sessionHandle.protocol.getValue}"
+
+        response = 
webTarget.path(s"api/v1/sessions/$serializedSessionHandle/info/13")

Review comment:
       Maybe we can define them in the document?  Because they are all 
immutable.

##########
File path: 
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/SessionsResource.scala
##########
@@ -61,14 +57,24 @@ private[v1] class SessionsResource extends 
ApiRequestContext {
     }
   }
 
+  @GET
+  @Path("{sessionHandle}/info/{infoType}")
+  def getInfo(@PathParam("sessionHandle") sessionHandleStr: String,
+              @PathParam("infoType") infoType: Int): InfoDetail = {
+    val sessionHandle = getSessionHandle(sessionHandleStr)
+    val info = TGetInfoType.findByValue(infoType.toInt)

Review comment:
       Done

##########
File path: 
kyuubi-server/src/test/scala/org/apache/kyuubi/server/api/v1/SessionsResourceSuite.scala
##########
@@ -171,4 +171,26 @@ class SessionsResourceSuite extends KyuubiFunSuite {
         assert(404 == response.getStatus)
     }
   }
+
+  test("test get infoType") {
+    val requestObj = SessionOpenRequest(
+      1, "admin", "123456", "localhost", Map("testConfig" -> "testValue"))
+
+    RestFrontendServiceSuite.withKyuubiRestServer {
+      (_, _, _, webTarget) =>
+        var response: Response = webTarget.path("api/v1/sessions")
+          .request(MediaType.APPLICATION_JSON_TYPE)
+          .post(Entity.entity(requestObj, MediaType.APPLICATION_JSON_TYPE))
+
+        val sessionHandle = response.readEntity(classOf[SessionHandle])
+        val serializedSessionHandle = s"${sessionHandle.identifier.publicId}|" 
+
+          
s"${sessionHandle.identifier.secretId}|${sessionHandle.protocol.getValue}"
+
+        response = 
webTarget.path(s"api/v1/sessions/$serializedSessionHandle/info/13")

Review comment:
       OK

##########
File path: 
kyuubi-server/src/test/scala/org/apache/kyuubi/server/api/v1/SessionsResourceSuite.scala
##########
@@ -171,4 +171,26 @@ class SessionsResourceSuite extends KyuubiFunSuite {
         assert(404 == response.getStatus)
     }
   }
+
+  test("test get infoType") {
+    val requestObj = SessionOpenRequest(
+      1, "admin", "123456", "localhost", Map("testConfig" -> "testValue"))
+
+    RestFrontendServiceSuite.withKyuubiRestServer {
+      (_, _, _, webTarget) =>
+        var response: Response = webTarget.path("api/v1/sessions")
+          .request(MediaType.APPLICATION_JSON_TYPE)
+          .post(Entity.entity(requestObj, MediaType.APPLICATION_JSON_TYPE))
+
+        val sessionHandle = response.readEntity(classOf[SessionHandle])
+        val serializedSessionHandle = s"${sessionHandle.identifier.publicId}|" 
+
+          
s"${sessionHandle.identifier.secretId}|${sessionHandle.protocol.getValue}"
+
+        response = 
webTarget.path(s"api/v1/sessions/$serializedSessionHandle/info/13")

Review comment:
       Maybe we can define it in the document?  Because they are all immutable.

##########
File path: 
kyuubi-server/src/test/scala/org/apache/kyuubi/server/api/v1/SessionsResourceSuite.scala
##########
@@ -171,4 +171,26 @@ class SessionsResourceSuite extends KyuubiFunSuite {
         assert(404 == response.getStatus)
     }
   }
+
+  test("test get infoType") {
+    val requestObj = SessionOpenRequest(
+      1, "admin", "123456", "localhost", Map("testConfig" -> "testValue"))
+
+    RestFrontendServiceSuite.withKyuubiRestServer {
+      (_, _, _, webTarget) =>
+        var response: Response = webTarget.path("api/v1/sessions")
+          .request(MediaType.APPLICATION_JSON_TYPE)
+          .post(Entity.entity(requestObj, MediaType.APPLICATION_JSON_TYPE))
+
+        val sessionHandle = response.readEntity(classOf[SessionHandle])
+        val serializedSessionHandle = s"${sessionHandle.identifier.publicId}|" 
+
+          
s"${sessionHandle.identifier.secretId}|${sessionHandle.protocol.getValue}"
+
+        response = 
webTarget.path(s"api/v1/sessions/$serializedSessionHandle/info/13")

Review comment:
       Maybe we can define them in the document?  Because they are all 
immutable.

##########
File path: 
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/SessionsResource.scala
##########
@@ -61,14 +57,24 @@ private[v1] class SessionsResource extends 
ApiRequestContext {
     }
   }
 
+  @GET
+  @Path("{sessionHandle}/info/{infoType}")
+  def getInfo(@PathParam("sessionHandle") sessionHandleStr: String,
+              @PathParam("infoType") infoType: Int): InfoDetail = {
+    val sessionHandle = getSessionHandle(sessionHandleStr)
+    val info = TGetInfoType.findByValue(infoType.toInt)

Review comment:
       Done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to