biangjuang commented on code in PR #5412:
URL: https://github.com/apache/kyuubi/pull/5412#discussion_r1360895288


##########
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:
   Sounds good.  I will add it in the method name, so it will be like this:
   
   ```  
   def resolvePathIfRelative(conf: KyuubiConf, configEntry: 
ConfigEntry[String]): File = {
       val dirFromConfig = conf.get(configEntry)
       Paths.get(sys.env.getOrElse(KyuubiConf.KYUUBI_HOME, 
".")).resolve(dirFromConfig).toFile
     }
   ```
   



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to