Search before creation
Documentation Related
In store/src/main/java/org/apache/rocketmq/store/CommitLog.java, DefaultAppendMessageCallback#doAppend(...) currently contains:
// Write messages to the queue buffer
byteBuffer.put(preEncodeBuffer);
The comment is misleading. The byteBuffer is the destination buffer supplied by DefaultMappedFile#appendMessagesInner(...) for appending the encoded message through the CommitLog write path. Depending on configuration, it can be backed by the mapped byte buffer, the transient write buffer, or a shared staging buffer used by the writeWithoutMmap path. It is not a queue or ConsumeQueue buffer.
The comment should describe appending the encoded message to the current CommitLog buffer. This is a documentation-only correction and does not change runtime behavior.
Are you willing to submit PR?
Search before creation
Documentation Related
In
store/src/main/java/org/apache/rocketmq/store/CommitLog.java,DefaultAppendMessageCallback#doAppend(...)currently contains:The comment is misleading. The
byteBufferis the destination buffer supplied byDefaultMappedFile#appendMessagesInner(...)for appending the encoded message through the CommitLog write path. Depending on configuration, it can be backed by the mapped byte buffer, the transient write buffer, or a shared staging buffer used by thewriteWithoutMmappath. It is not a queue or ConsumeQueue buffer.The comment should describe appending the encoded message to the current CommitLog buffer. This is a documentation-only correction and does not change runtime behavior.
Are you willing to submit PR?