Use zkUtils instead of zkClient in AdminUtils
Author: Balint Molnar
Reviewers: Ismael Juma
Closes from baluchicken/KAFKA-5103
@@ -567,7 +567,7 @@ object AdminUtils extends Logging with AdminUtilities {
// create the change notification
val seqNode = ZkUtils.ConfigChangesPath + "/" + EntityConfigChangeZnodePrefix
val content = Json.encode(getConfigChangeZnodeData(sanitizedEntityPath))
- zkUtils.zkClient.createPersistentSequential(seqNode, content)
+ zkUtils.createSequentialPersistentPath(seqNode, content)
}
def getConfigChangeZnodeData(sanitizedEntityPath: String) : Map[String, Any] = {
@@ -588,7 +588,8 @@ object AdminUtils extends Logging with AdminUtilities {
*/
def fetchEntityConfig(zkUtils: ZkUtils, rootEntityType: String, sanitizedEntityName: String): Properties = {
val entityConfigPath = getEntityConfigPath(rootEntityType, sanitizedEntityName)
- val str: String = zkUtils.zkClient.readData(entityConfigPath, true)
+ // readDataMaybeNull returns Some(null) if the path exists, but there is no data
+ val str: String = zkUtils.readDataMaybeNull(entityConfigPath)._1.orNull
val props = new Properties()
if (str != null) {
Json.parseFull(str) match {
