You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/09/26 13:30:04 UTC
[GitHub] [rocketmq] dingshuangxi888 commented on a change in pull request #3149: [ISSUE #3148]Support metadata export
dingshuangxi888 commented on a change in pull request #3149:
URL: https://github.com/apache/rocketmq/pull/3149#discussion_r716204820
##########
File path: tools/src/main/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExtImpl.java
##########
@@ -955,12 +973,49 @@ public SubscriptionGroupWrapper getAllSubscriptionGroup(final String brokerAddr,
}
@Override
- public TopicConfigSerializeWrapper getAllTopicGroup(final String brokerAddr,
+ public SubscriptionGroupWrapper getUserSubscriptionGroup(final String brokerAddr,
+ long timeoutMillis) throws InterruptedException,
+ RemotingTimeoutException, RemotingSendRequestException, RemotingConnectException, MQBrokerException {
+ SubscriptionGroupWrapper subscriptionGroupWrapper = this.mqClientInstance.getMQClientAPIImpl()
+ .getAllSubscriptionGroup(brokerAddr, timeoutMillis);
+
+ Iterator<Entry<String, SubscriptionGroupConfig>> iterator = subscriptionGroupWrapper.getSubscriptionGroupTable()
+ .entrySet().iterator();
+ while (iterator.hasNext()) {
+ Map.Entry<String, SubscriptionGroupConfig> configEntry = iterator.next();
+ if (MixAll.isSysConsumerGroup(configEntry.getKey()) || SYSTEM_GROUP_SET.contains(configEntry.getKey())) {
+ iterator.remove();
+ }
+ }
+
+ return subscriptionGroupWrapper;
+ }
+
+ @Override
+ public TopicConfigSerializeWrapper getAllTopicConfig(final String brokerAddr,
long timeoutMillis) throws InterruptedException,
RemotingTimeoutException, RemotingSendRequestException, RemotingConnectException, MQBrokerException {
return this.mqClientInstance.getMQClientAPIImpl().getAllTopicConfig(brokerAddr, timeoutMillis);
}
+ @Override
+ public TopicConfigSerializeWrapper getUserTopicConfig(final String brokerAddr, final boolean specialTopic,
+ long timeoutMillis) throws InterruptedException, RemotingException,
+ MQBrokerException, MQClientException {
+ TopicConfigSerializeWrapper topicConfigSerializeWrapper = this.getAllTopicConfig(brokerAddr, timeoutMillis);
+ TopicList topicList = this.mqClientInstance.getMQClientAPIImpl().getSystemTopicListFromBroker(brokerAddr,
+ timeoutMillis);
+ Iterator<Entry<String, TopicConfig>> iterator = topicConfigSerializeWrapper.getTopicConfigTable().entrySet()
+ .iterator();
+ while (iterator.hasNext()) {
+ String topic = iterator.next().getKey();
+ if (topicList.getTopicList().contains(topic) || !specialTopic && (topic.startsWith(MixAll.RETRY_GROUP_TOPIC_PREFIX) || topic.startsWith(MixAll.DLQ_GROUP_TOPIC_PREFIX))) {
Review comment:
!specialTopic && (topic.startsWith(MixAll.RETRY_GROUP_TOPIC_PREFIX) || topic.startsWith(MixAll.DLQ_GROUP_TOPIC_PREFIX))
这段逻辑是不是应该再加个括号
--
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: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org