You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/04/28 02:44:14 UTC
[GitHub] [rocketmq] BurningCN opened a new pull request #2843: [ISSUE #2842] Optimize the code that HAClient handles the Bod
BurningCN opened a new pull request #2843:
URL: https://github.com/apache/rocketmq/pull/2843
**Make sure set the target branch to `develop`**
## What is the purpose of the change
Optimize the code that HAClient handles the Body
for issue 2842
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] dongeforever commented on a change in pull request #2843: [ISSUE #2842] Optimize the code that HAClient handles the Bod
Posted by GitBox <gi...@apache.org>.
dongeforever commented on a change in pull request #2843:
URL: https://github.com/apache/rocketmq/pull/2843#discussion_r790517247
##########
File path: store/src/main/java/org/apache/rocketmq/store/ha/HAService.java
##########
@@ -452,11 +452,13 @@ private boolean dispatchReadRequest() {
}
if (diff >= (msgHeaderSize + bodySize)) {
- byte[] bodyData = new byte[bodySize];
- this.byteBufferRead.position(this.dispatchPosition + msgHeaderSize);
- this.byteBufferRead.get(bodyData);
+ if (bodySize > 0) {
+ byte[] bodyData = new byte[bodySize];
+ this.byteBufferRead.position(this.dispatchPosition + msgHeaderSize);
Review comment:
Here will cause an unnecessary copy of the data.
If boySize == 0, just ignore the appendToCommitlog.
--
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: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] BurningCN closed pull request #2843: [ISSUE #2842] Optimize the code that HAClient handles the Bod
Posted by GitBox <gi...@apache.org>.
BurningCN closed pull request #2843:
URL: https://github.com/apache/rocketmq/pull/2843
--
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: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] coveralls commented on pull request #2843: [ISSUE #2842] Optimize the code that HAClient handles the Bod
Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #2843:
URL: https://github.com/apache/rocketmq/pull/2843#issuecomment-828103341
[](https://coveralls.io/builds/39174682)
Coverage increased (+0.08%) to 52.234% when pulling **c4ee0233f2704451913d6acd05ab03ca99c4107d on BurningCN:polish_ha_code** into **f77d7fee6877d3face1a3ae4f105fd9720d37262 on apache:develop**.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org