yanghua commented on a change in pull request #1317:
URL: https://github.com/apache/incubator-kyuubi/pull/1317#discussion_r742904985
##########
File path:
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/SessionsResource.scala
##########
@@ -88,12 +104,27 @@ private[v1] class SessionsResource extends
ApiRequestContext {
@DELETE
@Path("{sessionHandle}")
def closeSession(@PathParam("sessionHandle") sessionHandleStr: String):
Response = {
- val splitSessionHandle = sessionHandleStr.split("\\|")
- val handleIdentifier = new HandleIdentifier(
- UUID.fromString(splitSessionHandle(0)),
UUID.fromString(splitSessionHandle(1)))
- val protocolVersion =
TProtocolVersion.findByValue(splitSessionHandle(2).toInt)
- val sessionHandle = new SessionHandle(handleIdentifier, protocolVersion)
+ val sessionHandle = getSessionHandle(sessionHandleStr)
backendService.closeSession(sessionHandle)
Response.ok().build()
}
+
+ def getSessionHandle(sessionHandleStr: String): SessionHandle = {
+ try {
+ val splitSessionHandle = sessionHandleStr.split("\\|")
+ val handleIdentifier = new HandleIdentifier(
+ UUID.fromString(splitSessionHandle(0)),
UUID.fromString(splitSessionHandle(1)))
+ val protocolVersion =
TProtocolVersion.findByValue(splitSessionHandle(2).toInt)
Review comment:
restful API tries to interact with Kyuubi Server AFAP. It may provide a
full capacity like the thrift protocol has provided (create sessions then fetch
them). On the other hand, it also may provide management for Kyuubi server at
any time, which means it would not create them but can fetch and interact with
them. So it should support the session handles which contain `TProtocolVersion
`?
--
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]