mjsax commented on code in PR #21515:
URL: https://github.com/apache/kafka/pull/21515#discussion_r2835471802
##########
streams/src/main/java/org/apache/kafka/streams/state/internals/ValueTimestampHeadersDeserializer.java:
##########
@@ -127,11 +132,12 @@ static <T> T value(final byte[] rawValueTimestampHeaders,
final Deserializer<T>
final ByteBuffer buffer = ByteBuffer.wrap(rawValueTimestampHeaders);
final int headersSize = ByteUtils.readVarint(buffer);
- // skip headers plus timestamp
- buffer.position(buffer.position() + headersSize + Long.BYTES);
+ final byte[] rawHeaders = readBytes(buffer, headersSize);
+ final Headers headers = HeadersDeserializer.deserialize(rawHeaders);
+ buffer.position(buffer.position() + Long.BYTES); // skip timestamp
final byte[] bytes = readBytes(buffer, buffer.remaining());
- return deserializer.deserialize("", bytes);
+ return deserializer.deserialize("", headers, bytes);
Review Comment:
One more fix... @UladzislauBlok pointed me to it! Great find.
Base on this, I am wondering about "lazy header deserialization" idea...
Left a comment on https://issues.apache.org/jira/browse/KAFKA-20155
--
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]