You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "fuyou001 (via GitHub)" <gi...@apache.org> on 2023/01/30 03:05:16 UTC

[GitHub] [rocketmq] fuyou001 commented on a diff in pull request #5948: [ISSUE #5947]Optimize RouteInfoManager#pickupTopicRouteData create BrokerData code

fuyou001 commented on code in PR #5948:
URL: https://github.com/apache/rocketmq/pull/5948#discussion_r1090137307


##########
namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java:
##########
@@ -678,10 +678,7 @@ public TopicRouteData pickupTopicRouteData(final String topic) {
                     if (null == brokerData) {
                         continue;
                     }
-                    BrokerData brokerDataClone = new BrokerData(brokerData.getCluster(),
-                        brokerData.getBrokerName(),
-                        (HashMap<Long, String>) brokerData.getBrokerAddrs().clone(),
-                        brokerData.isEnableActingMaster(), brokerData.getZoneName());
+                    BrokerData brokerDataClone = new BrokerData(brokerData);

Review Comment:
   why not make a deep copy of  a BrokerData 



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