Github user lvfangmin commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/684#discussion_r238787735
--- Diff:
zookeeper-server/src/main/java/org/apache/zookeeper/server/DumbWatcher.java ---
@@ -69,7 +69,7 @@ public void sendCloseSession() { }
void setSessionId(long sessionId) { }
@Override
- void sendBuffer(ByteBuffer closeConn) { }
+ void sendBuffer(ByteBuffer... closeConn) { }
--- End diff --
In order to reduce the GC effort by re-using the cached serialized data, we
need to break the single response packet into different part, the length
buffer, the header buffer, and the data buffer, length and header will be built
every time, but data buffer is reused, that's why we changed this to pass in a
buffers list.
---