dajac commented on a change in pull request #9964:
URL: https://github.com/apache/kafka/pull/9964#discussion_r565222866



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/processor/internals/assignment/SubscriptionInfo.java
##########
@@ -265,14 +265,7 @@ public ByteBuffer encode() {
                 "Should never try to encode a SubscriptionInfo with version [" 
+
                     data.version() + "] > LATEST_SUPPORTED_VERSION [" + 
LATEST_SUPPORTED_VERSION + "]"
             );
-        } else {
-            final ObjectSerializationCache cache = new 
ObjectSerializationCache();
-            final ByteBuffer buffer = ByteBuffer.allocate(data.size(cache, 
(short) data.version()));
-            final ByteBufferAccessor accessor = new ByteBufferAccessor(buffer);
-            data.write(accessor, cache, (short) data.version());
-            buffer.rewind();

Review comment:
       `MessageUtil.toByteBuffer` uses `flip` whereas `rewind` is used here. 
Does it make any difference in this particular case?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to