Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #5947]Optimize RouteInfoManager#pickupTopicRouteData create BrokerData code #5948

Merged
merged 1 commit into from
Feb 16, 2023

Conversation

mxsm
Copy link
Member

@mxsm mxsm commented Jan 29, 2023

Make sure set the target branch to develop

What is the purpose of the change

close #5947

Brief changelog

  • Optimize RouteInfoManager#pickupTopicRouteData create BrokerData code

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.

  • Make sure there is a Github issue 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.
  • 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.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • 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.
  • 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.

@codecov-commenter
Copy link

Codecov Report

Merging #5948 (ff2aaae) into develop (bcaebf1) will decrease coverage by 0.06%.
The diff coverage is 25.00%.

@@              Coverage Diff              @@
##             develop    #5948      +/-   ##
=============================================
- Coverage      43.37%   43.31%   -0.06%     
  Complexity      8798     8798              
=============================================
  Files           1090     1090              
  Lines          76435    76433       -2     
  Branches        9987     9987              
=============================================
- Hits           33150    33108      -42     
- Misses         39137    39176      +39     
- Partials        4148     4149       +1     
Impacted Files Coverage Δ
...e/rocketmq/remoting/protocol/route/BrokerData.java 30.00% <0.00%> (-0.44%) ⬇️
...e/rocketmq/namesrv/routeinfo/RouteInfoManager.java 63.25% <100.00%> (-0.18%) ⬇️
...ache/rocketmq/broker/client/ConsumerGroupInfo.java 69.29% <0.00%> (-3.51%) ⬇️
...a/org/apache/rocketmq/broker/BrokerController.java 43.25% <0.00%> (-3.43%) ⬇️
...rocketmq/common/message/MessageClientIDSetter.java 71.42% <0.00%> (-2.39%) ⬇️
...va/org/apache/rocketmq/store/util/PerfCounter.java 64.39% <0.00%> (-2.10%) ⬇️
...ache/rocketmq/proxy/common/ReceiptHandleGroup.java 65.30% <0.00%> (-2.05%) ⬇️
...he/rocketmq/broker/processor/PopReviveService.java 39.41% <0.00%> (-1.35%) ⬇️
...ent/impl/consumer/DefaultLitePullConsumerImpl.java 68.12% <0.00%> (-0.79%) ⬇️
...a/org/apache/rocketmq/store/StoreStatsService.java 33.97% <0.00%> (-0.56%) ⬇️
... and 10 more

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

brokerData.getBrokerName(),
(HashMap<Long, String>) brokerData.getBrokerAddrs().clone(),
brokerData.isEnableActingMaster(), brokerData.getZoneName());
BrokerData brokerDataClone = new BrokerData(brokerData);
Copy link
Contributor

Choose a reason for hiding this comment

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

why not make a deep copy of a BrokerData

Copy link
Member Author

@mxsm mxsm Jan 30, 2023

Choose a reason for hiding this comment

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

why not make a deep copy of a BrokerData

I see that the constructor does the job @fuyou001 , I'm going to add a deep clone method to each of the three classes(TopicRouteData,QueueData,BrokerData) when submitting a PR

@mxsm mxsm requested a review from fuyou001 January 30, 2023 03:29
@RongtongJin RongtongJin merged commit 3f14b2b into apache:develop Feb 16, 2023
drpmma pushed a commit that referenced this pull request Feb 21, 2023
@mxsm mxsm deleted the rocketmq-5947 branch February 27, 2023 07:18
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.

Optimize RouteInfoManager#pickupTopicRouteData create BrokerData code
4 participants