Skip to content

Commit

Permalink
[ISSUE #4123] Explicit type argument can be replaced with <> for Rout…
Browse files Browse the repository at this point in the history
…eInfoManager (#4124)

* Explicit type argument can be replaced with <> for RouteInfoManager

* Explicit type argument can be replaced with <> for RouteInfoManager
  • Loading branch information
li-xiao-shuang authored Apr 17, 2022
1 parent 84f03c3 commit 50e314e
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ public class RouteInfoManager {
private final HashMap<String/* brokerAddr */, List<String>/* Filter Server */> filterServerTable;

public RouteInfoManager() {
this.topicQueueTable = new HashMap<String, Map<String, QueueData>>(1024);
this.brokerAddrTable = new HashMap<String, BrokerData>(128);
this.clusterAddrTable = new HashMap<String, Set<String>>(32);
this.brokerLiveTable = new HashMap<String, BrokerLiveInfo>(256);
this.filterServerTable = new HashMap<String, List<String>>(256);
this.topicQueueTable = new HashMap<>(1024);
this.brokerAddrTable = new HashMap<>(128);
this.clusterAddrTable = new HashMap<>(32);
this.brokerLiveTable = new HashMap<>(256);
this.filterServerTable = new HashMap<>(256);
}

public ClusterInfo getAllClusterInfo() {
Expand Down Expand Up @@ -120,7 +120,7 @@ public RegisterBrokerResult registerBroker(

Set<String> brokerNames = this.clusterAddrTable.get(clusterName);
if (null == brokerNames) {
brokerNames = new HashSet<String>();
brokerNames = new HashSet<>();
this.clusterAddrTable.put(clusterName, brokerNames);
}
brokerNames.add(brokerName);
Expand All @@ -130,7 +130,7 @@ public RegisterBrokerResult registerBroker(
BrokerData brokerData = this.brokerAddrTable.get(brokerName);
if (null == brokerData) {
registerFirst = true;
brokerData = new BrokerData(clusterName, brokerName, new HashMap<Long, String>());
brokerData = new BrokerData(clusterName, brokerName, new HashMap<>());
this.brokerAddrTable.put(brokerName, brokerData);
}
Map<Long, String> brokerAddrsMap = brokerData.getBrokerAddrs();
Expand Down Expand Up @@ -383,11 +383,11 @@ public TopicRouteData pickupTopicRouteData(final String topic) {
TopicRouteData topicRouteData = new TopicRouteData();
boolean foundQueueData = false;
boolean foundBrokerData = false;
Set<String> brokerNameSet = new HashSet<String>();
List<BrokerData> brokerDataList = new LinkedList<BrokerData>();
Set<String> brokerNameSet = new HashSet<>();
List<BrokerData> brokerDataList = new LinkedList<>();
topicRouteData.setBrokerDatas(brokerDataList);

HashMap<String, List<String>> filterServerMap = new HashMap<String, List<String>>();
HashMap<String, List<String>> filterServerMap = new HashMap<>();
topicRouteData.setFilterServerTable(filterServerMap);

try {
Expand Down

0 comments on commit 50e314e

Please sign in to comment.