Skip to content

Conversation

@mxsm
Copy link
Member

@mxsm mxsm commented Mar 5, 2023

Fixes #3343

Motivation

Explain the content here.
Explain why you want to make the changes and what problem you're trying to solve.

Modifications

Optimize Codec.Encoder and Codec.Decoder

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
  • If a feature is not applicable for documentation, explain why?
  • If a feature is not documented yet in this PR, please create a followup issue for adding the documentation

@codecov
Copy link

codecov bot commented Mar 5, 2023

Codecov Report

Merging #3344 (a40b3c7) into master (94562e9) will increase coverage by 0.01%.
The diff coverage is 9.37%.

❗ Current head a40b3c7 differs from pull request most recent head 9479a13. Consider uploading reports for the commit 9479a13 to get more accurate results

@@             Coverage Diff              @@
##             master    #3344      +/-   ##
============================================
+ Coverage     13.04%   13.05%   +0.01%     
- Complexity     1191     1192       +1     
============================================
  Files           550      550              
  Lines         28700    28708       +8     
  Branches       2850     2850              
============================================
+ Hits           3743     3747       +4     
- Misses        24632    24636       +4     
  Partials        325      325              
Impacted Files Coverage Δ
...e/consumergroup/event/ConsumerGroupStateEvent.java 0.00% <0.00%> (ø)
...group/event/ConsumerGroupTopicConfChangeEvent.java 0.00% <0.00%> (ø)
...e/core/protocol/http/consumer/ConsumerManager.java 0.00% <0.00%> (ø)
...che/eventmesh/common/protocol/tcp/codec/Codec.java 58.33% <66.66%> (ø)
...g/apache/eventmesh/spi/EventMeshExtensionType.java 92.30% <100.00%> (+0.64%) ⬆️
...entmesh/connector/redis/client/RedissonClient.java 52.27% <0.00%> (+6.81%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@xwm1992 xwm1992 requested a review from lrhkobe March 7, 2023 15:46
@xwm1992
Copy link
Contributor

xwm1992 commented Mar 7, 2023

@lrhkobe please help review this pr.

int bodyLength = ArrayUtils.getLength(bodyData);

int length = 4 + 4 + headerLength + bodyLength;
int length = headerLength + bodyLength;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line need to change:
int length = CONSTANT_MAGIC_FLAG.length + VERSION.length + headerLength + bodyLength;

final int length = in.readInt();
final int headerLength = in.readInt();
final int bodyLength = length - 8 - headerLength;
final int bodyLength = length - headerLength;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line need to change:
final int bodyLength = length - CONSTANT_MAGIC_FLAG.length - VERSION.length - headerLength;

@mxsm mxsm requested review from xwm1992 and removed request for lrhkobe March 8, 2023 03:25
@mxsm
Copy link
Member Author

mxsm commented Mar 8, 2023

@xwm1992 done, PTAL~

@xwm1992 xwm1992 merged commit a3a559d into apache:master Mar 8, 2023
@mxsm mxsm deleted the eventmesh-3343 branch March 8, 2023 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Optimize Codec.Encoder and Codec.Decoder

2 participants