> On Oct. 7, 2013, 5 p.m., Neha Narkhede wrote:
> > core/src/main/scala/kafka/consumer/ZookeeperConsumerConnector.scala, line 
> > 319
> > <https://reviews.apache.org/r/14497/diff/1/?file=361459#file361459line319>
> >
> >     This comment is a bit misleading. The data change watch for the 
> > /brokers/topics path is only set in reinitializeConsumer() which is invoked 
> > on startup and when new topics are discovered through wildcards. Doesn't 
> > zkclient automatically re-register watches once they are fired ?
> 
> Guozhang Wang wrote:
>     I am not sure if the zkClient auto re-register upon watcher fired, but I 
> read from the source code that the watcher will be re-registered upon reading 
> the subscribed path. I made the above comment since in rebalance the 
> getPartitionAssignmentForTopics function call will read the /brokers/topics 
> path and hence set the watchers.
> 
> Guozhang Wang wrote:
>     This is what I found for IZkDataListener (the English seems not very easy 
> to understand though :P ):
>     
>     "An IZkDataListener can be registered at a ZkClient for listening on zk 
> data changes for a given path. Node: Also this listener re-subscribes it 
> watch for the path on each zk event (zk watches are one-timers) is is not 
> guaranteed that events on the path are missing (see 
> http://zookeeper.wiki.sourceforge.net/ZooKeeperWatches). An implementation of 
> this class should take that into account. "

http://pastebin.com/pZQAXnxd. Zkclient does re-register the watch *before* 
reading the path, which is what I wanted to check. I think we are good to go 
here. 

"I made the above comment since in rebalance the 
getPartitionAssignmentForTopics function call will read the /brokers/topics 
path and hence set the watchers."

This is not true. It re-registers the watch when it fires the data change 
event, not when you read the path.

It is worth making that clear in your comment.


- Neha


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/14497/#review26705
-----------------------------------------------------------


On Oct. 7, 2013, 5:25 p.m., Guozhang Wang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/14497/
> -----------------------------------------------------------
> 
> (Updated Oct. 7, 2013, 5:25 p.m.)
> 
> 
> Review request for kafka.
> 
> 
> Bugs: KAFKA-1075
>     https://issues.apache.org/jira/browse/KAFKA-1075
> 
> 
> Repository: kafka
> 
> 
> Description
> -------
> 
> KAFKA-1075.v2
> 
> 
> KAFKA-1075.v1
> 
> 
> Diffs
> -----
> 
>   core/src/main/scala/kafka/consumer/ZookeeperConsumerConnector.scala 
> 08b4b7218f62f876eb95628bd6db78c0956c7f04 
> 
> Diff: https://reviews.apache.org/r/14497/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Guozhang Wang
> 
>

Reply via email to