zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lvfangmin <...@git.apache.org>
Subject [GitHub] zookeeper pull request #684: ZOOKEEPER-3180: Add response cache to improve t...
Date Tue, 04 Dec 2018 18:57:23 GMT
Github user lvfangmin commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/684#discussion_r238788174
  
    --- Diff: zookeeper-server/src/main/java/org/apache/zookeeper/server/NIOServerCnxn.java
---
    @@ -235,10 +237,12 @@ void handleWrite(SelectionKey k) throws IOException, CloseRequestException
{
                     if (bb == ServerCnxnFactory.closeConn) {
                         throw new CloseRequestException("close requested");
                     }
    +                if (bb == packetSentinel) {
    --- End diff --
    
    Since we separate the response into multiple pieces, length, header, data, we need a way
to tell if it's the end of a response or not, and the sentinel is added for this purpose.


---

Mime
View raw message