mirror of https://github.com/apache/kafka.git
KAFKA-5134; Replace zkClient.getChildren method with zkUtils.getChildren
Author: Balint Molnar <balintmolnar91@gmail.com> Reviewers: Ismael Juma <ismael@juma.me.uk> Closes #3097 from baluchicken/KAFKA-5134-2
This commit is contained in:
parent
0816e47bfe
commit
272956f03a
|
@ -77,8 +77,8 @@ class ZkNodeChangeNotificationListener(private val zkUtils: ZkUtils,
|
|||
* Process all changes
|
||||
*/
|
||||
def processAllNotifications() {
|
||||
val changes = zkUtils.zkClient.getChildren(seqNodeRoot)
|
||||
processNotifications(changes.asScala.sorted)
|
||||
val changes = zkUtils.getChildren(seqNodeRoot)
|
||||
processNotifications(changes.sorted)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -65,7 +65,7 @@ class ZookeeperTopicEventWatcher(val zkUtils: ZkUtils,
|
|||
lock.synchronized {
|
||||
try {
|
||||
if (zkUtils != null) {
|
||||
val latestTopics = zkUtils.zkClient.getChildren(ZkUtils.BrokerTopicsPath).asScala
|
||||
val latestTopics = zkUtils.getChildren(ZkUtils.BrokerTopicsPath)
|
||||
debug("all topics: %s".format(latestTopics))
|
||||
eventHandler.handleTopicEvent(latestTopics)
|
||||
}
|
||||
|
|
|
@ -416,13 +416,8 @@ class ZookeeperConsumerConnectorTest extends KafkaServerTestHarness with Logging
|
|||
}
|
||||
|
||||
def getZKChildrenValues(path : String) : Seq[Tuple2[String,String]] = {
|
||||
val children = zkUtils.zkClient.getChildren(path)
|
||||
Collections.sort(children)
|
||||
val childrenAsSeq : Seq[java.lang.String] = {
|
||||
import scala.collection.JavaConversions._
|
||||
children.toSeq
|
||||
}
|
||||
childrenAsSeq.map(partition =>
|
||||
val children = zkUtils.getChildren(path).sorted
|
||||
children.map(partition =>
|
||||
(partition, zkUtils.zkClient.readData(path + "/" + partition).asInstanceOf[String]))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue