You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by fe...@apache.org on 2023/03/14 06:01:58 UTC
[kyuubi] branch master updated: [KYUUBI #4506] Return sessionType in session data
This is an automated email from the ASF dual-hosted git repository.
feiwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/master by this push:
new 316c9fd53 [KYUUBI #4506] Return sessionType in session data
316c9fd53 is described below
commit 316c9fd537f0482e81a3b7e44893509ee7ff1ebd
Author: fwang12 <fw...@ebay.com>
AuthorDate: Tue Mar 14 14:01:49 2023 +0800
[KYUUBI #4506] Return sessionType in session data
### _Why are the changes needed?_
As title.
### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
- [ ] Add screenshots for manual tests if appropriate
- [ ] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request
Closes #4506 from turboFei/session_data_type.
Closes #4506
9617ee68c [fwang12] Session type
Authored-by: fwang12 <fw...@ebay.com>
Signed-off-by: fwang12 <fw...@ebay.com>
---
.../org/apache/kyuubi/client/api/v1/dto/SessionData.java | 13 ++++++++++++-
.../main/scala/org/apache/kyuubi/server/api/ApiUtils.scala | 3 ++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/api/v1/dto/SessionData.java b/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/api/v1/dto/SessionData.java
index 233fee721..97da4d942 100644
--- a/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/api/v1/dto/SessionData.java
+++ b/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/api/v1/dto/SessionData.java
@@ -32,6 +32,7 @@ public class SessionData {
private Long duration;
private Long idleTime;
private String exception;
+ private String sessionType;
public SessionData() {}
@@ -43,7 +44,8 @@ public class SessionData {
Long createTime,
Long duration,
Long idleTime,
- String exception) {
+ String exception,
+ String sessionType) {
this.identifier = identifier;
this.user = user;
this.ipAddr = ipAddr;
@@ -52,6 +54,7 @@ public class SessionData {
this.duration = duration;
this.idleTime = idleTime;
this.exception = exception;
+ this.sessionType = sessionType;
}
public String getIdentifier() {
@@ -121,6 +124,14 @@ public class SessionData {
this.exception = exception;
}
+ public String getSessionType() {
+ return sessionType;
+ }
+
+ public void setSessionType(String sessionType) {
+ this.sessionType = sessionType;
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) return true;
diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/ApiUtils.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/ApiUtils.scala
index dbdd34ead..7a0582613 100644
--- a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/ApiUtils.scala
+++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/ApiUtils.scala
@@ -36,7 +36,8 @@ object ApiUtils {
session.createTime,
session.lastAccessTime - session.createTime,
session.getNoOperationTime,
- session.getSessionEvent.flatMap(_.exception).map(Utils.prettyPrint).getOrElse(""))
+ session.getSessionEvent.flatMap(_.exception).map(Utils.prettyPrint).getOrElse(""),
+ session.sessionType.toString)
}
def operationData(operation: KyuubiOperation): OperationData = {