/** * Blocks the current thread and awaits ZooKeeper to start running locally on the given port. * * @param zkPort The ZooKeeper Port. * @param secureZk Flag to notify whether the ZK is secure. * @param trustStore Location of the trust store. * @param keyStore Location of the key store. * @param keyStorePasswordPath Location of password path for key store. * Empty string if `secureZk` is false or a password does not exist. * @param trustStorePasswordPath Location of password path for trust store. * Empty string if `secureZk` is false or a password does not exist. * @return True if ZooKeeper started within a specified timeout, false otherwise. */ public static boolean waitForServerUp(int zkPort, boolean secureZk, String trustStore, String keyStore, String keyStorePasswordPath, String trustStorePasswordPath) { val address = LOOPBACK_ADDRESS + ":" + zkPort; if (secureZk) { return waitForSSLServerUp(address, LocalBookKeeper.CONNECTION_TIMEOUT, trustStore, keyStore, keyStorePasswordPath, trustStorePasswordPath); } else { return LocalBookKeeper.waitForServerUp(address, LocalBookKeeper.CONNECTION_TIMEOUT); } }