RongtongJin commented on code in PR #10514:
URL: https://github.com/apache/rocketmq/pull/10514#discussion_r3449480492
##########
remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingCommand.java:
##########
@@ -509,6 +529,29 @@ public ByteBuffer encodeHeader(final int bodyLength) {
return result;
}
+ public ByteBuffer fastEncodeHeaderAsBuffer(final int bodyLength) {
Review Comment:
I don't see a caller for this new method in this PR. The transfer paths that
still require a `ByteBuffer` (`ManyMessageTransfer`, `QueryMessageTransfer`,
`OneMessageTransfer`) continue to call `encodeHeader(...)`, so this does not
reduce those allocations until it is actually wired in. Please either use this
in the intended page-cache transfer paths with coverage for the returned buffer
lifecycle, or leave it out of this PR to avoid adding unused public surface.
--
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]