This is an automated email from the ASF dual-hosted git repository.
yikaifei 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 4642550b0 [KYUUBI #6376] Improve closeEngine method names and logs due
to closeSession
4642550b0 is described below
commit 4642550b0769b9be6263119e5a770fd39fb79389
Author: yikaifei <[email protected]>
AuthorDate: Sat May 11 11:10:56 2024 +0800
[KYUUBI #6376] Improve closeEngine method names and logs due to closeSession
# :mag: Description
## Issue References ๐
This pull request aims to improve closeEngine method names and logs due to
closeSession.
when the share level is `CONNECTION`, closeSession triggers the
closeEngine, there are some minor issues with logging and method name.
## Describe Your Solution ๐ง
Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that are
required for this change.
## Types of changes :bookmark:
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
## Test Plan ๐งช
#### Behavior Without This Pull Request :coffin:
#### Behavior With This Pull Request :tada:
#### Related Unit Tests
---
# Checklist ๐
- [x] This patch was not authored or co-authored using [Generative
Tooling](https://www.apache.org/legal/generative-tooling.html)
**Be nice. Be informative.**
Closes #6376 from yikf/rename-close-session.
Closes #6376
b03661b24 [yikaifei] rename closeSession
Authored-by: yikaifei <[email protected]>
Signed-off-by: yikaifei <[email protected]>
---
.../org/apache/kyuubi/engine/chat/session/ChatSessionManager.scala | 6 +++---
.../apache/kyuubi/engine/flink/session/FlinkSQLSessionManager.scala | 6 +++---
.../org/apache/kyuubi/engine/hive/session/HiveSessionManager.scala | 2 +-
.../org/apache/kyuubi/engine/jdbc/session/JdbcSessionManager.scala | 6 +++---
.../apache/kyuubi/engine/spark/session/SparkSQLSessionManager.scala | 6 +++---
.../apache/kyuubi/engine/trino/session/TrinoSessionManager.scala | 6 +++---
6 files changed, 16 insertions(+), 16 deletions(-)
diff --git
a/externals/kyuubi-chat-engine/src/main/scala/org/apache/kyuubi/engine/chat/session/ChatSessionManager.scala
b/externals/kyuubi-chat-engine/src/main/scala/org/apache/kyuubi/engine/chat/session/ChatSessionManager.scala
index ff5c4748e..ea7afb8b5 100644
---
a/externals/kyuubi-chat-engine/src/main/scala/org/apache/kyuubi/engine/chat/session/ChatSessionManager.scala
+++
b/externals/kyuubi-chat-engine/src/main/scala/org/apache/kyuubi/engine/chat/session/ChatSessionManager.scala
@@ -59,12 +59,12 @@ class ChatSessionManager(name: String)
override def closeSession(sessionHandle: SessionHandle): Unit = {
super.closeSession(sessionHandle)
if (conf.get(ENGINE_SHARE_LEVEL) == ShareLevel.CONNECTION.toString) {
- info("Session stopped due to shared level is Connection.")
- stopSession()
+ info("Chat engine stopped due to session stopped and shared level is
CONNECTION.")
+ stopEngine()
}
}
- private def stopSession(): Unit = {
+ private def stopEngine(): Unit = {
ChatEngine.currentEngine.foreach(_.stop())
}
}
diff --git
a/externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/session/FlinkSQLSessionManager.scala
b/externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/session/FlinkSQLSessionManager.scala
index 2a72029d4..bb179bc6f 100644
---
a/externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/session/FlinkSQLSessionManager.scala
+++
b/externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/session/FlinkSQLSessionManager.scala
@@ -90,12 +90,12 @@ class FlinkSQLSessionManager(engineContext: DefaultContext)
warn(s"Error closing session $sessionHandle", t)
}
if (shareLevel == ShareLevel.CONNECTION) {
- info("Session stopped due to shared level is Connection.")
- stopSession()
+ info("Flink engine stopped due to session stopped and shared level is
CONNECTION.")
+ stopEngine()
}
}
- private def stopSession(): Unit = {
+ private def stopEngine(): Unit = {
FlinkSQLEngine.currentEngine.foreach(_.stop())
}
diff --git
a/externals/kyuubi-hive-sql-engine/src/main/scala/org/apache/kyuubi/engine/hive/session/HiveSessionManager.scala
b/externals/kyuubi-hive-sql-engine/src/main/scala/org/apache/kyuubi/engine/hive/session/HiveSessionManager.scala
index ef98f5b0a..a9cabf0a7 100644
---
a/externals/kyuubi-hive-sql-engine/src/main/scala/org/apache/kyuubi/engine/hive/session/HiveSessionManager.scala
+++
b/externals/kyuubi-hive-sql-engine/src/main/scala/org/apache/kyuubi/engine/hive/session/HiveSessionManager.scala
@@ -172,7 +172,7 @@ class HiveSessionManager(engine: HiveSQLEngine) extends
SessionManager("HiveSess
override def closeSession(sessionHandle: SessionHandle): Unit = {
super.closeSession(sessionHandle)
if (conf.get(ENGINE_SHARE_LEVEL) == ShareLevel.CONNECTION.toString) {
- info("Session stopped due to shared level is Connection.")
+ info("Hive engine stopped due to session stopped and shared level is
CONNECTION.")
engine.stop()
}
}
diff --git
a/externals/kyuubi-jdbc-engine/src/main/scala/org/apache/kyuubi/engine/jdbc/session/JdbcSessionManager.scala
b/externals/kyuubi-jdbc-engine/src/main/scala/org/apache/kyuubi/engine/jdbc/session/JdbcSessionManager.scala
index 101a06e71..eb5513e8a 100644
---
a/externals/kyuubi-jdbc-engine/src/main/scala/org/apache/kyuubi/engine/jdbc/session/JdbcSessionManager.scala
+++
b/externals/kyuubi-jdbc-engine/src/main/scala/org/apache/kyuubi/engine/jdbc/session/JdbcSessionManager.scala
@@ -55,12 +55,12 @@ class JdbcSessionManager(name: String)
override def closeSession(sessionHandle: SessionHandle): Unit = {
super.closeSession(sessionHandle)
if (conf.get(ENGINE_SHARE_LEVEL) == ShareLevel.CONNECTION.toString) {
- info("Session stopped due to shared level is Connection.")
- stopSession()
+ info("JDBC engine stopped due to session stopped and shared level is
CONNECTION.")
+ stopEngine()
}
}
- private def stopSession(): Unit = {
+ private def stopEngine(): Unit = {
JdbcSQLEngine.currentEngine.foreach { engine =>
engine.selfExited = true
engine.stop()
diff --git
a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/session/SparkSQLSessionManager.scala
b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/session/SparkSQLSessionManager.scala
index b6768c697..574d98cfa 100644
---
a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/session/SparkSQLSessionManager.scala
+++
b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/session/SparkSQLSessionManager.scala
@@ -200,12 +200,12 @@ class SparkSQLSessionManager private (name: String,
spark: SparkSession)
}
}
if (shareLevel == ShareLevel.CONNECTION) {
- info("Session stopped due to shared level is Connection.")
- stopSession()
+ info("Spark engine stopped due to session stopped and shared level is
CONNECTION.")
+ stopEngine()
}
}
- private def stopSession(): Unit = {
+ private def stopEngine(): Unit = {
SparkSQLEngine.currentEngine.foreach(_.stop())
}
diff --git
a/externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/session/TrinoSessionManager.scala
b/externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/session/TrinoSessionManager.scala
index 55aa2f3fa..c6f7ba393 100644
---
a/externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/session/TrinoSessionManager.scala
+++
b/externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/session/TrinoSessionManager.scala
@@ -45,12 +45,12 @@ class TrinoSessionManager
override def closeSession(sessionHandle: SessionHandle): Unit = {
super.closeSession(sessionHandle)
if (conf.get(ENGINE_SHARE_LEVEL) == ShareLevel.CONNECTION.toString) {
- info("Session stopped due to shared level is Connection.")
- stopSession()
+ info("Trino engine stopped due to session stopped and shared level is
CONNECTION.")
+ stopEngine()
}
}
- private def stopSession(): Unit = {
+ private def stopEngine(): Unit = {
TrinoSqlEngine.currentEngine.foreach(_.stop())
}