QuorumPeer's run method will setupRequestProcessor (assembly processor), setupRequestProcessor is rewritten, according to the stand-alone or cluster, assembled into three different 责任链
, the following figure is the stand-alone mode
When the server receives the client request, it will submit the request through NIOServerCnxn submitRequest. After submitting the request and entering 责任链模式
one of the processors of the responsibility chain, the request will be placed in the queue first. The processor itself is a thread, and its own run method is from Get the data in the queue and call the next chain of responsibility to achieve asynchronous.