You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "pan3793 (via GitHub)" <gi...@apache.org> on 2023/10/16 14:22:55 UTC
Re: [PR] Resolve the relative zk configuration dir based on KYUUBI_HOME, and make the configuration kyuubi.zookeeper.embedded.data.log.dir effective [kyuubi]
pan3793 commented on code in PR #5412:
URL: https://github.com/apache/kyuubi/pull/5412#discussion_r1360744291
##########
kyuubi-zookeeper/src/main/scala/org/apache/kyuubi/zookeeper/EmbeddedZookeeper.scala:
##########
@@ -88,4 +97,15 @@ class EmbeddedZookeeper extends AbstractService("EmbeddedZookeeper") {
assert(zks != null, s"$getName is in $getServiceState")
s"$host:${serverFactory.getLocalPort}"
}
+
+ def resolveRelativePathFromConf(conf: KyuubiConf, configEntry: ConfigEntry[String]): String = {
+ val dirFromConfig = conf.get(configEntry)
+ if (Paths.get(dirFromConfig).isAbsolute) {
+ dirFromConfig
+ } else {
+ val kyuubiHomePrefix = sys.env.getOrElse(KyuubiConf.KYUUBI_HOME, ".") + File.separator
+ kyuubiHomePrefix + dirFromConfig
+ }
Review Comment:
Could it be simplified with
```suggestion
Paths.get(sys.env.getOrElse(KyuubiConf.KYUUBI_HOME, ".")).resolve(dirFromConfig)
```
?
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org