yanghua commented on a change in pull request #1317:
URL: https://github.com/apache/incubator-kyuubi/pull/1317#discussion_r741581052
##########
File path:
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/SessionsResource.scala
##########
@@ -61,6 +57,16 @@ private[v1] class SessionsResource extends ApiRequestContext
{
}
}
+ @GET
+ @Path("{sessionHandle}/info/{infotype}")
Review comment:
Keep the same code style about `sessionHandle ` and `infotype `?
camelCase or not?
##########
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:
We may need an API (in the following PR) to get all the enums of
`TGetInfoType`, otherwise, no one knows what does the `13` mean and how many
numbers like this (from the client). WDYT?
##########
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:
sounds good
##########
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:
FYI: added this API into the design doc.
##########
File path:
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/SessionsResource.scala
##########
@@ -61,6 +57,16 @@ private[v1] class SessionsResource extends ApiRequestContext
{
}
}
+ @GET
+ @Path("{sessionHandle}/info/{infotype}")
Review comment:
Keep the same code style about `sessionHandle ` and `infotype `?
camelCase or not?
##########
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:
We may need an API (in the following PR) to get all the enums of
`TGetInfoType`, otherwise, no one knows what does the `13` mean and how many
numbers like this (from the client). WDYT?
##########
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:
sounds good
##########
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:
FYI: added this API into the design doc.
--
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]