[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12896996#action_12896996
 ] 

Sergey Doroshenko commented on ZOOKEEPER-733:
---------------------------------------------

I noticed that NettyServerCnxn class contains big copy-paste of all 4-letter 
commands and checkFourLetterWord method is also almost identical to one in 
NIOServerCnxn. The only difference is: 
1) commands in NettyCnxn don't extendThread 
2) checkFourLetterWord methods differ in I/O a bit. But big "if (len==someCmd) 
{ start someCmd }" part is the same.

So, questions:
1) is there any practical reason for commands in NIOCnxn being Threads? If no, 
they are identical with ones from NettyCnxn, so we could move all commands to 
ServerCnxn superclass 
2) big part of checkFourLetterWord (IO-unrelated one, described above) could 
also be moved to superclass



> use netty to handle client connections
> --------------------------------------
>
>                 Key: ZOOKEEPER-733
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-733
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: server
>            Reporter: Benjamin Reed
>            Assignee: Patrick Hunt
>             Fix For: 3.4.0
>
>         Attachments: accessive.jar, flowctl.zip, moved.zip, 
> QuorumTestFailed_sessionmoved_TRACE_LOG.txt.gz, ZOOKEEPER-733.patch, 
> ZOOKEEPER-733.patch, ZOOKEEPER-733.patch, ZOOKEEPER-733.patch, 
> ZOOKEEPER-733.patch, ZOOKEEPER-733.patch, ZOOKEEPER-733.patch, 
> ZOOKEEPER-733.patch, ZOOKEEPER-733.patch
>
>
> we currently have our own asynchronous NIO socket engine to be able to handle 
> lots of clients with a single thread. over time the engine has become more 
> complicated. we would also like the engine to use multiple threads on 
> machines with lots of cores. plus, we would like to be able to support things 
> like SSL. if we switch to netty, we can simplify our code and get the 
> previously mentioned benefits.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to