caigy commented on code in PR #8403:
URL: https://github.com/apache/rocketmq/pull/8403#discussion_r1684220949


##########
store/src/main/java/org/apache/rocketmq/store/ConsumeQueue.java:
##########
@@ -833,7 +833,13 @@ private boolean putMessagePositionInfo(final long offset, 
final int size, final
                 }
             }
             this.setMaxPhysicOffset(offset + size);
-            return mappedFile.appendMessage(this.byteBufferIndex.array());
+            boolean appendResult;
+            if 
(messageStore.getMessageStoreConfig().isPutConsumeQueueDataByFileChannel()) {
+                appendResult = 
mappedFile.appendMessageUsingFileChannel(this.byteBufferIndex.array());

Review Comment:
   `byteBufferIndex`, of which type is `ByteBuffer`, is transformed to `byte[]` 
and then transformed back into `ByteBuffer` in 
`DefaultMappedFile.appendMessageUsingFileChannel()`. IMO it's unnecessary.



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