Cobar-Reactor
2017-10-27 14:39:17 0 举报
Cobar-Reactor模型
作者其他创作
大纲/内容
writeQ
write
生成Acceptor
write by R
READ
Processor
R
key
ssc
selector.selectedKeys
execute
W
handle
Exe SQL!
EventLoop
ACCEPT
HandlerThread Pool
Reactor
ssc.accept()
registerQ
唤醒
Route SQL
NIOAcceptor
enable Key WRITE
selector.select(1000)!
NIOProcessor
key.interestOps(key.interestOps() | SelectionKey.OP_WRITE);
register OP_READ
生成Processor中的R
SelectionKey
read()
ReactorW
channel
Excutor
H
blockingQueue
merge result
E
nextProcessor()
RegisterQ
reactorR(R)
ReactorR
selector
Exe SQLsync for merge
Handler
registerQ.poll()
NIOReactor
阻塞方法
Acceptor
Thread
selector.wakeup()
writeQueue.take()!
Main
Connection
!
read
reactorR.selector.wakeup()
write()
ExecutorThread Pool
FrontendConnection
enable OP_WRITE
reactorW(W)
抽象数据流图来源于官方
客户端连接Cobar,触发select()方法
register
make(channel)
0 条评论
下一页