yaooqinn commented on a change in pull request #1892:
URL: https://github.com/apache/incubator-kyuubi/pull/1892#discussion_r804423520
##########
File path:
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionImpl.scala
##########
@@ -45,11 +50,30 @@ class KyuubiSessionImpl(
extends AbstractSession(protocol, user, password, ipAddress, conf,
sessionManager) {
override val handle: SessionHandle = SessionHandle(protocol)
- // TODO: needs improve the hardcode
- normalizedConf.foreach {
- case ("use:database", _) =>
- case ("kyuubi.engine.pool.size.threshold", _) =>
- case (key, value) => sessionConf.set(key, value)
+ override val normalizedConf: Map[String, String] = {
+ val userSpecifiedConf = new util.HashMap[String, String]()
+ // TODO: needs improve the hardcode
+ super.normalizedConf.foreach {
+ case ("use:database", _) =>
+ case ("kyuubi.engine.pool.size.threshold", _) =>
+ case (key, value) =>
+ sessionConf.set(key, value)
+ userSpecifiedConf.put(key, value)
+ }
+
+ val sessionConfMap = ImmutableMap.copyOf[String,
String](sessionConf.getAll.asJava)
+ val confOverlay = sessionManager.sessionConfAdvisor.getConfOverlay(
+ user,
+ sessionConfMap)
+ if (confOverlay != null) {
+ confOverlay.asScala.foreach {
+ case (key, value) =>
+ sessionConf.set(key, value)
+ userSpecifiedConf.put(key, value)
+ }
+ }
+
+ userSpecifiedConf.asScala.toMap
Review comment:
simply add ?
```scala
private[kyuubi] val optimizedConf: Map[String, String] = {
val confOverlay = sessionManager.sessionConfAdvisor. getConfOverlay(
user,
normalizedConf.asJava)
normalizedConf ++ confOverlay.asScala
}
// TODO: needs improve the hardcode
optimizedConf.foreach {
case ("use:database", _) =>
case ("kyuubi.engine.pool.size.threshold", _) =>
case (key, value) => sessionConf.set(key, value)
}
```
--
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]