@Override public int compareTo(BrokerData o) { return this.brokerName.compareTo(o.getBrokerName()); }
@Override public int compareTo(BrokerData o) { return this.brokerName.compareTo(o.getBrokerName()); }
@Override public int compareTo(BrokerData o) { return this.brokerName.compareTo(o.getBrokerName()); }
private String findTopicBelongToWhichCluster(final String topic, final ClusterInfo clusterInfo, final DefaultMQAdminExt defaultMQAdminExt) throws RemotingException, MQClientException, InterruptedException { TopicRouteData topicRouteData = defaultMQAdminExt.examineTopicRouteInfo(topic); BrokerData brokerData = topicRouteData.getBrokerDatas().get(0); String brokerName = brokerData.getBrokerName(); Iterator<Entry<String, Set<String>>> it = clusterInfo.getClusterAddrTable().entrySet().iterator(); while (it.hasNext()) { Entry<String, Set<String>> next = it.next(); if (next.getValue().contains(brokerName)) { return next.getKey(); } } return null; } }
@Override public Set<String> getTopicClusterList(final String topic) throws InterruptedException, MQBrokerException, MQClientException, RemotingException { Set<String> clusterSet = new HashSet<String>(); ClusterInfo clusterInfo = examineBrokerClusterInfo(); TopicRouteData topicRouteData = examineTopicRouteInfo(topic); BrokerData brokerData = topicRouteData.getBrokerDatas().get(0); String brokerName = brokerData.getBrokerName(); Iterator<Map.Entry<String, Set<String>>> it = clusterInfo.getClusterAddrTable().entrySet().iterator(); while (it.hasNext()) { Map.Entry<String, Set<String>> next = it.next(); if (next.getValue().contains(brokerName)) { clusterSet.add(next.getKey()); } } return clusterSet; }
String brokerAddr = entry.getValue(); if (brokerAddr.equals(brokerAddrFound)) { brokerNameFound = brokerData.getBrokerName(); it.remove(); log.info( itBrokerAddrTable.remove(); log.info("remove brokerName[{}] from brokerAddrTable, because channel destroyed", brokerData.getBrokerName());
if (null != brokerData) { BrokerData brokerDataClone = new BrokerData(); brokerDataClone.setBrokerName(brokerData.getBrokerName()); brokerDataClone.setBrokerAddrs((HashMap<Long, String>) brokerData .getBrokerAddrs().clone());
String addr = null; for (BrokerData brokerData : topicRoute.getBrokerDatas()) { if (brokerData.getBrokerName().equals(mq.getBrokerName())) { addr = brokerData.selectBrokerAddr(); break;
this.brokerAddrTable.put(bd.getBrokerName(), bd.getBrokerAddrs());
this.brokerAddrTable.put(bd.getBrokerName(), bd.getBrokerAddrs());
orderTopicString.append(brokerData.getBrokerName()); orderTopicString.append(" at addr : "); orderTopicString.append(addr);
orderTopicString.append(brokerData.getBrokerName()); orderTopicString.append(":"); orderTopicString.append(queueNum);
this.mqClientInstance.getMQClientAPIImpl().getTopicStatsInfo(addr, topic, timeoutMillis).getOffsetTable(); for (int i = 0; i < topicRouteMap.get(addr); i++) { MessageQueue queue = new MessageQueue(topic, bd.getBrokerName(), i); OffsetWrapper offsetWrapper = new OffsetWrapper(); offsetWrapper.setBrokerOffset(topicStatus.get(queue).getMaxOffset());
BrokerData brokerData = null; for (BrokerData bd : route.getBrokerDatas()) { if (bd.getBrokerName().equals(qd.getBrokerName())) { brokerData = bd; break;
BrokerData brokerData = null; for (BrokerData bd : route.getBrokerDatas()) { if (bd.getBrokerName().equals(qd.getBrokerName())) { brokerData = bd; break;