zookeeper-client
2019-06-20 17:33:36 0 举报
zookeeper 客户端源码uml类图和核心的流程图理解
作者其他创作
大纲/内容
outgoingQueue
工作线程
消息加入等待队列
pendingQueue
服务端
均衡负载接口,用于对zookeeper集群进行均衡负载
<interface>HostProvider
发送消息
<interface>ClientWatchManager
+ materialize(): return Set<Watcher>
ClientCnxnSocketNetty
+ attribute1:type = defaultValue+ attribute2:type- attribute3:type
+ operation1(params):returnType- operation2(params)- operation3()
SendThread
- clientCnxnSocket:type = ClientCnxnSocket+ attribute2:type- attribute3:type
- run(): return void- startConnect(InetSocketAddress addr):return void- primeConnection()- operation3()
将消息转化为事件
ZKWatchManager
sendThread
Zookeeper
- watchManager:ZKWatchManager- hostProvider:HostProvider- cnxn:ClientCnxn
消息检验
回应消息
ZooKeeperThread
EventThread
- waitingEvents:LinkedBlockingQueue<Object>
ClientCnxn
- sendThread :SendThread- eventThread: EventThread- outgoingQueue:LinkedBlockingDeque<Packet>- pendingQueue:Queue<Packet>
ClientCnxnSocket
waitingEvents
ClientCnxnSocketNIO
从等待队列获取消息进行检验
zookeeper
获取事件
获取消息
eventThread
返回服务端结果
收藏
收藏
0 条评论
回复 删除
下一页