Gerrrr commented on a change in pull request #11945:
URL: https://github.com/apache/kafka/pull/11945#discussion_r839408097



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/kstream/internals/foreignkeyjoin/SubscriptionResponseWrapperSerde.java
##########
@@ -92,6 +103,32 @@ public void setIfUnset(final SerdeGetter getter) {
             return buf.array();
         }
 
+        private byte[] serializeV1(final String topic, final 
SubscriptionResponseWrapper<V> data) {
+            final byte[] serializedData = data.getForeignValue() == null ? 
null : serializer.serialize(topic, data.getForeignValue());
+            final int serializedDataLength = serializedData == null ? 0 : 
serializedData.length;
+            final long[] originalHash = data.getOriginalValueHash();
+            final int hashLength = originalHash == null ? 0 : 2 * Long.BYTES;
+            final int primaryPartitionLength = Integer.BYTES;
+            final int dataLength = 1 + hashLength + serializedDataLength + 
primaryPartitionLength;
+
+            final ByteBuffer buf = ByteBuffer.allocate(dataLength);
+
+            if (originalHash != null) {
+                buf.put(data.getVersion());
+            } else {
+                buf.put((byte) (data.getVersion() | (byte) 0x80));
+            }
+            buf.putInt(data.getPrimaryPartition());

Review comment:
       Fixed in 13e772e9d075d4c7f609eacf9855c0c0afb9ad2b.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to