vismaytiwari opened a new pull request, #22791:
URL: https://github.com/apache/kafka/pull/22791

   JIRA: https://issues.apache.org/jira/browse/KAFKA-19877
   
   The `deserialize(String, Headers, ByteBuffer)` Javadoc currently says only 
what callers and implementations *cannot* assume about the buffer (position, 
limit, capacity), but never what they *can* — which leaves the readable region 
and side-effect expectations unclear. The reporter hit a `serializedValueSize` 
regression after switching to this overload for zero-copy deserialization.
   
   This adds a short clarification: the serialized bytes are the buffer's 
`remaining()` bytes (between `position` and `limit`), and implementations 
should not modify the buffer's `position`/`limit`/`mark`, since the caller 
retains ownership and may read the buffer again afterward.
   
   I kept this to the actionable, non-controversial part and framed it 
conservatively. If the intended contract differs (e.g. on the exact `position` 
semantics — I noticed `Utils.toArray` and `Utils.readBytes` aren't fully 
consistent here), I'm happy to adjust; the goal is to close the documentation 
gap the issue describes.
   
   Supersedes the stale #21371 (auto-closed for inactivity).
   
   Docs-only change; no tests.
   
   AI disclosure: drafted with Claude (Claude Code) and reviewed before 
submitting; the commit carries the `Co-Authored-By` trailer per the 
contributing guide.
   


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