pan3793 commented on a change in pull request #1359:
URL: https://github.com/apache/incubator-kyuubi/pull/1359#discussion_r746361942



##########
File path: 
kyuubi-ha/src/main/scala/org/apache/kyuubi/ha/client/ZooKeeperClientProvider.scala
##########
@@ -55,6 +59,35 @@ object ZooKeeperClientProvider extends Logging {
       case UNTIL_ELAPSED => new RetryUntilElapsed(maxSleepTime, baseSleepTime)
       case _ => new ExponentialBackoffRetry(baseSleepTime, maxRetries)
     }
+    val chrootIndex = connectionStr.indexOf("/")
+    val chrootOption = {
+      if (chrootIndex > 0) Some(connectionStr.substring(chrootIndex))
+      else None
+    }
+    // make sure zookeeper chroot path exists
+    chrootOption.foreach { chroot =>
+      val zkConnectionForChrootCreation = connectionStr.substring(0, 
chrootIndex)
+      val clonedConf = KyuubiConf(false)
+      clonedConf.set(HA_ZK_QUORUM, zkConnectionForChrootCreation)

Review comment:
       We can remove this logic and add a parameter `createChrootIfNecessary: 
Boolean = false` to the method to avoid checking chroot everytime.




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


Reply via email to