KAFKA-20193: Remove static <T> T value(...) method from ValueTimestampHeadersDeserializer if not needed#21539
Open
asknishant wants to merge 1 commit intoapache:trunkfrom
Open
KAFKA-20193: Remove static <T> T value(...) method from ValueTimestampHeadersDeserializer if not needed#21539asknishant wants to merge 1 commit intoapache:trunkfrom
static <T> T value(...) method from ValueTimestampHeadersDeserializer if not needed#21539asknishant wants to merge 1 commit intoapache:trunkfrom
Conversation
|
A label of 'needs-attention' was automatically added to this PR in order to raise the |
13fbd76 to
b974ccd
Compare
76da708 to
e2154fe
Compare
…ampHeadersDeserializer if not needed
zheguang
reviewed
Apr 1, 2026
| } | ||
| return deserializer.deserialize("", Utils.rawPlainValue(rawValueTimestampHeaders)); | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
accidental newline? :). Should be okay though as checkstyle doesn't pick on it.
zheguang
reviewed
Apr 1, 2026
Contributor
zheguang
left a comment
There was a problem hiding this comment.
Thanks for the PR, @asknishant . It looks good to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: Remove static T value(...) method
The method acted as a utility to extract only the original payload value out of a serialized ValueTimestampHeaders byte array without needing to deserialize the entire object.
According to KIP-1271, the objects are serialized in this format: [headersSize (varint)] + [headersBytes...] + [timestamp (8 bytes)] + [actual value payload]
The value(...) method performed an optimized shortcut by:
Wrapping the bytes in a ByteBuffer.
Peeking at the headersSize to know how long the headers sequence was.
Repositioning its pointer (skipping over the headersBytes and skipping the 8-byte timestamp).
Taking the rest of the bytes at the end of the array and passing them straight to the nested deserializer.
It essentially allowed grabbing the inner value payload while ignoring the headers and timestamp overhead, but since this specific read pattern wasn't actively needed in the Kafka Streams codebase anymore, removing it avoided maintaining unused code.
Reviewers: @aliehsaeedii @bbejeck @mjsax