Skip to content

Commit

Permalink
[ISSUE #5947] Optimize RouteInfoManager#pickupTopicRouteData create B…
Browse files Browse the repository at this point in the history
…rokerData code (#5948)
  • Loading branch information
mxsm authored Feb 16, 2023
1 parent 9fc5038 commit 3f14b2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

brokerDataList.add(brokerDataClone);
foundBrokerData = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public BrokerData(BrokerData brokerData) {
if (brokerData.brokerAddrs != null) {
this.brokerAddrs = new HashMap<>(brokerData.brokerAddrs);
}
this.zoneName = brokerData.zoneName;
this.enableActingMaster = brokerData.enableActingMaster;
}

Expand All @@ -64,14 +65,16 @@ public BrokerData(String cluster, String brokerName, HashMap<Long, String> broke
this.brokerAddrs = brokerAddrs;
}

public BrokerData(String cluster, String brokerName, HashMap<Long, String> brokerAddrs, boolean enableActingMaster) {
public BrokerData(String cluster, String brokerName, HashMap<Long, String> brokerAddrs,
boolean enableActingMaster) {
this.cluster = cluster;
this.brokerName = brokerName;
this.brokerAddrs = brokerAddrs;
this.enableActingMaster = enableActingMaster;
}

public BrokerData(String cluster, String brokerName, HashMap<Long, String> brokerAddrs, boolean enableActingMaster, String zoneName) {
public BrokerData(String cluster, String brokerName, HashMap<Long, String> brokerAddrs, boolean enableActingMaster,
String zoneName) {
this.cluster = cluster;
this.brokerName = brokerName;
this.brokerAddrs = brokerAddrs;
Expand Down

0 comments on commit 3f14b2b

Please sign in to comment.