tongyi007 发表于 2019-1-8 08:03:44

Zookeeper Client端流程

1.ClientConn封装RequstHeader,Request并提交到outgoing Queue,阻塞等待
2.SendThread唤醒ClientConnSocket,由其从outgoing queue取请求并进行数据传输,包括Xid的分配也是在这里进行;并将Packet加入pending queue
3.当ClientConnSocket接收到消息时,调用SendThread进行读请求处理,构建ReplyHeader并调用EventThread将WatchEvent(如果设定的话)加入waitingEvent列表
4.EventThread异步检查waitingEvent,发现后调用Watcher的process流程,由watcher具体实现
http://blog.运维网.com/attachment/201310/020539338.png



页: [1]
查看完整版本: Zookeeper Client端流程