You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/11/03 09:19:02 UTC
[GitHub] [rocketmq] liweiyuan opened a new pull request, #5463: [ISSUE #5462] Remove RemotingCommand.decode parse header repeated calculation
liweiyuan opened a new pull request, #5463:
URL: https://github.com/apache/rocketmq/pull/5463
**Make sure set the target branch to `develop`**
## What is the purpose of the change
XXXXX
## Brief changelog
- remove repeated calculation in RemotingCommand.decode
## Verifying this change
XXXX
Follow this checklist to help us incorporate your contribution quickly and easily. Notice, `it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR`.
- [x] Make sure there is a [Github issue](https://github.com/apache/rocketmq/issues) filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
- [x] Format the pull request title like `[ISSUE #123] Fix UnknownException when host config not exist`. Each commit in the pull request should have a meaningful subject line and body.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in [test module](https://github.com/apache/rocketmq/tree/master/test).
- [x] Run `mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle` to make sure basic checks pass. Run `mvn clean install -DskipITs` to make sure unit-test pass. Run `mvn clean test-compile failsafe:integration-test` to make sure integration-test pass.
- [ ] If this contribution is large, please file an [Apache Individual Contributor License Agreement](http://www.apache.org/licenses/#clas).
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] liweiyuan commented on pull request #5463: [ISSUE #5462] Remove RemotingCommand.decode parse header repeated calculation
Posted by GitBox <gi...@apache.org>.
liweiyuan commented on PR #5463:
URL: https://github.com/apache/rocketmq/pull/5463#issuecomment-1305377925
Again rebase code
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] liweiyuan closed pull request #5463: [ISSUE #5462] Remove RemotingCommand.decode parse header repeated calculation
Posted by GitBox <gi...@apache.org>.
liweiyuan closed pull request #5463: [ISSUE #5462] Remove RemotingCommand.decode parse header repeated calculation
URL: https://github.com/apache/rocketmq/pull/5463
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] liweiyuan commented on a diff in pull request #5463: [ISSUE #5462] Remove RemotingCommand.decode parse header repeated calculation
Posted by GitBox <gi...@apache.org>.
liweiyuan commented on code in PR #5463:
URL: https://github.com/apache/rocketmq/pull/5463#discussion_r1013558421
##########
remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingCommand.java:
##########
@@ -181,13 +181,12 @@ public static RemotingCommand decode(final ByteBuffer byteBuffer) throws Remotin
public static RemotingCommand decode(final ByteBuf byteBuffer) throws RemotingCommandException {
int length = byteBuffer.readableBytes();
- int oriHeaderLen = byteBuffer.readInt();
- int headerLength = getHeaderLength(oriHeaderLen);
+ int headerLength = byteBuffer.readInt();
Review Comment:
to optimize the code, support get protocol type from ByteBuf
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] codecov-commenter commented on pull request #5463: [ISSUE #5462] Remove RemotingCommand.decode parse header repeated calculation
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #5463:
URL: https://github.com/apache/rocketmq/pull/5463#issuecomment-1304500743
# [Codecov](https://codecov.io/gh/apache/rocketmq/pull/5463?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#5463](https://codecov.io/gh/apache/rocketmq/pull/5463?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (07e8088) into [develop](https://codecov.io/gh/apache/rocketmq/commit/61fa3b0c232ea21910de0979f0a0c0b8024efda7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (61fa3b0) will **decrease** coverage by `0.00%`.
> The diff coverage is `100.00%`.
```diff
@@ Coverage Diff @@
## develop #5463 +/- ##
=============================================
- Coverage 43.18% 43.18% -0.01%
- Complexity 8070 8075 +5
=============================================
Files 1025 1025
Lines 72177 72195 +18
Branches 9558 9560 +2
=============================================
+ Hits 31173 31177 +4
- Misses 37064 37076 +12
- Partials 3940 3942 +2
```
| [Impacted Files](https://codecov.io/gh/apache/rocketmq/pull/5463?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...he/rocketmq/remoting/protocol/RemotingCommand.java](https://codecov.io/gh/apache/rocketmq/pull/5463/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3Rpbmcvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3JlbW90aW5nL3Byb3RvY29sL1JlbW90aW5nQ29tbWFuZC5qYXZh) | `70.24% <100.00%> (+1.83%)` | :arrow_up: |
| [...ketmq/common/protocol/body/ConsumerConnection.java](https://codecov.io/gh/apache/rocketmq/pull/5463/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jb21tb24vcHJvdG9jb2wvYm9keS9Db25zdW1lckNvbm5lY3Rpb24uamF2YQ==) | `95.83% <0.00%> (-4.17%)` | :arrow_down: |
| [...ketmq/proxy/grpc/v2/channel/GrpcClientChannel.java](https://codecov.io/gh/apache/rocketmq/pull/5463/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHJveHkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3Byb3h5L2dycGMvdjIvY2hhbm5lbC9HcnBjQ2xpZW50Q2hhbm5lbC5qYXZh) | `54.65% <0.00%> (-3.49%)` | :arrow_down: |
| [...a/org/apache/rocketmq/filter/util/BloomFilter.java](https://codecov.io/gh/apache/rocketmq/pull/5463/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZmlsdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9maWx0ZXIvdXRpbC9CbG9vbUZpbHRlci5qYXZh) | `60.43% <0.00%> (-2.20%)` | :arrow_down: |
| [...ache/rocketmq/store/logfile/DefaultMappedFile.java](https://codecov.io/gh/apache/rocketmq/pull/5463/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3RvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3N0b3JlL2xvZ2ZpbGUvRGVmYXVsdE1hcHBlZEZpbGUuamF2YQ==) | `44.03% <0.00%> (-1.81%)` | :arrow_down: |
| [...ache/rocketmq/broker/client/ConsumerGroupInfo.java](https://codecov.io/gh/apache/rocketmq/pull/5463/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvY2xpZW50L0NvbnN1bWVyR3JvdXBJbmZvLmphdmE=) | `68.46% <0.00%> (-0.91%)` | :arrow_down: |
| [...ent/impl/consumer/DefaultLitePullConsumerImpl.java](https://codecov.io/gh/apache/rocketmq/pull/5463/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvaW1wbC9jb25zdW1lci9EZWZhdWx0TGl0ZVB1bGxDb25zdW1lckltcGwuamF2YQ==) | `68.38% <0.00%> (-0.78%)` | :arrow_down: |
| [...a/org/apache/rocketmq/store/StoreStatsService.java](https://codecov.io/gh/apache/rocketmq/pull/5463/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3RvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3N0b3JlL1N0b3JlU3RhdHNTZXJ2aWNlLmphdmE=) | `34.53% <0.00%> (-0.56%)` | :arrow_down: |
| [...ava/org/apache/rocketmq/filter/util/BitsArray.java](https://codecov.io/gh/apache/rocketmq/pull/5463/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZmlsdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9maWx0ZXIvdXRpbC9CaXRzQXJyYXkuamF2YQ==) | `59.82% <0.00%> (ø)` | |
| [.../org/apache/rocketmq/store/ha/DefaultHAClient.java](https://codecov.io/gh/apache/rocketmq/pull/5463/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3RvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3N0b3JlL2hhL0RlZmF1bHRIQUNsaWVudC5qYXZh) | `62.05% <0.00%> (+0.51%)` | :arrow_up: |
| ... and [6 more](https://codecov.io/gh/apache/rocketmq/pull/5463/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] lizhanhui commented on pull request #5463: [ISSUE #5462] Remove RemotingCommand.decode parse header repeated calculation
Posted by GitBox <gi...@apache.org>.
lizhanhui commented on PR #5463:
URL: https://github.com/apache/rocketmq/pull/5463#issuecomment-1305036618
Rebase to make CI pass first.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] liweiyuan commented on pull request #5463: [ISSUE #5462] Remove RemotingCommand.decode parse header repeated calculation
Posted by GitBox <gi...@apache.org>.
liweiyuan commented on PR #5463:
URL: https://github.com/apache/rocketmq/pull/5463#issuecomment-1308233675
ok,@tsunghanjacktsai
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] lizhanhui commented on a diff in pull request #5463: [ISSUE #5462] Remove RemotingCommand.decode parse header repeated calculation
Posted by GitBox <gi...@apache.org>.
lizhanhui commented on code in PR #5463:
URL: https://github.com/apache/rocketmq/pull/5463#discussion_r1012695357
##########
remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingCommand.java:
##########
@@ -181,13 +181,12 @@ public static RemotingCommand decode(final ByteBuffer byteBuffer) throws Remotin
public static RemotingCommand decode(final ByteBuf byteBuffer) throws RemotingCommandException {
int length = byteBuffer.readableBytes();
- int oriHeaderLen = byteBuffer.readInt();
- int headerLength = getHeaderLength(oriHeaderLen);
+ int headerLength = byteBuffer.readInt();
Review Comment:
According to the frame layout, the first byte of the header length is used as a bit-field, flagging how the header is serialized. Only the following 3 bytes are actually employed to represent header length.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] liweiyuan commented on pull request #5463: [ISSUE #5462] Remove RemotingCommand.decode parse header repeated calculation
Posted by GitBox <gi...@apache.org>.
liweiyuan commented on PR #5463:
URL: https://github.com/apache/rocketmq/pull/5463#issuecomment-1305077751
ok, have to rebase code .
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] tsunghanjacktsai commented on pull request #5463: [ISSUE #5462] Remove RemotingCommand.decode parse header repeated calculation
Posted by GitBox <gi...@apache.org>.
tsunghanjacktsai commented on PR #5463:
URL: https://github.com/apache/rocketmq/pull/5463#issuecomment-1306560577
Hey @liweiyuan , seems like you've sent multiple duplicated commits, be sure to squash them to keep your commit logs clean.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org