simon824 commented on a change in pull request #1317:
URL: https://github.com/apache/incubator-kyuubi/pull/1317#discussion_r742719169
##########
File path:
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/SessionsResource.scala
##########
@@ -45,19 +47,33 @@ private[v1] class SessionsResource extends
ApiRequestContext {
@GET
@Path("{sessionHandle}")
def sessionInfo(@PathParam("sessionHandle") sessionHandleStr: String):
SessionDetail = {
- 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)
try {
val session = backendService.sessionManager.getSession(sessionHandle)
SessionDetail(session.user, session.ipAddress, session.createTime,
sessionHandle,
session.lastAccessTime, session.lastIdleTime,
session.getNoOperationTime, session.conf)
} catch {
- case _: Throwable =>
- throw new NotFoundException()
+ case NonFatal(e) =>
+ error(s"Invalid $sessionHandle", e)
+ throw new NotFoundException(s"Invalid $sessionHandle")
+ }
+ }
+
+ @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)
Review comment:
backendService.getInfo will throw KyuubiSQLException and be catched.
--
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]