You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by 朱君 <yf...@360buy.com> on 2011/08/31 11:18:20 UTC

How does leader/follower invoke setupRequestProcessors()?

HI,

I am reading the source code of ZooKeeper 3.3.0, and stucked. 

After the instance of LeaderZooKeeperServer (inherit from QuorumZooKeeperServer which inherits from ZooKeeperServer ) has been created (in class QuorumPeer:657), where does it invoke setupRequestProcessors()? In standalone mode, it is easy to find whre setupRequestProcessors is called. But in quorum mode, i don't know how the function is invoked.

Thanks very much!

2011-08-31 



Jun 

Re: How does leader/follower invoke setupRequestProcessors()?

Posted by Mahadev Konar <ma...@hortonworks.com>.
You can follow the code to see that the startup() method (in
ZooKeeperServer()) is the one that leads to all the setup methods
being called. Take a look at ServerCnxnFactory.start() and you should
be able to follow how its being called.

OTOH, the start up code isnt very clean right now. It needs a little
bit of cleanup to make it more understandable.

hope that helps
mahadev

2011/8/31 朱君 <yf...@360buy.com>:
> HI,
>
> I am reading the source code of ZooKeeper 3.3.0, and stucked.
>
> After the instance of LeaderZooKeeperServer (inherit from QuorumZooKeeperServer which inherits from ZooKeeperServer ) has been created (in class QuorumPeer:657), where does it invoke setupRequestProcessors()? In standalone mode, it is easy to find whre setupRequestProcessors is called. But in quorum mode, i don't know how the function is invoked.
>
> Thanks very much!
>
> 2011-08-31
>
>
>
> Jun
>