提交 60d02121 编写于 作者: H huzongtang

polish codes for updateTopicPermSubCommand.

上级 db77463b
...@@ -107,7 +107,6 @@ public class UpdateTopicPermSubCommand implements SubCommand { ...@@ -107,7 +107,6 @@ public class UpdateTopicPermSubCommand implements SubCommand {
if (commandLine.hasOption('b')) { if (commandLine.hasOption('b')) {
String brokerAddr = commandLine.getOptionValue('b').trim(); String brokerAddr = commandLine.getOptionValue('b').trim();
List<BrokerData> brokerDatas = topicRouteData.getBrokerDatas(); List<BrokerData> brokerDatas = topicRouteData.getBrokerDatas();
boolean isBrokerLegal = false;
String brokerName = null; String brokerName = null;
for (BrokerData data : brokerDatas) { for (BrokerData data : brokerDatas) {
HashMap<Long, String> brokerAddrs = data.getBrokerAddrs(); HashMap<Long, String> brokerAddrs = data.getBrokerAddrs();
...@@ -116,17 +115,16 @@ public class UpdateTopicPermSubCommand implements SubCommand { ...@@ -116,17 +115,16 @@ public class UpdateTopicPermSubCommand implements SubCommand {
} }
for (Map.Entry<Long, String> entry : brokerAddrs.entrySet()) { for (Map.Entry<Long, String> entry : brokerAddrs.entrySet()) {
if (brokerAddr.equals(entry.getValue()) && MixAll.MASTER_ID == entry.getKey()) { if (brokerAddr.equals(entry.getValue()) && MixAll.MASTER_ID == entry.getKey()) {
isBrokerLegal = true;
brokerName = data.getBrokerName(); brokerName = data.getBrokerName();
break; break;
} }
} }
if (isBrokerLegal) { if (brokerName != null) {
break; break;
} }
} }
if (isBrokerLegal && brokerName != null) { if (brokerName != null) {
List<QueueData> queueDataList = topicRouteData.getQueueDatas(); List<QueueData> queueDataList = topicRouteData.getQueueDatas();
assert queueDataList != null && queueDataList.size() > 0; assert queueDataList != null && queueDataList.size() > 0;
int oldPerm = 0; int oldPerm = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册