You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tubemq.apache.org by GitBox <gi...@apache.org> on 2020/12/29 09:36:48 UTC

[GitHub] [incubator-tubemq] EMsnap commented on a change in pull request #375: [TUBEMQ-487] add new feature clone topic + batch add topics

EMsnap commented on a change in pull request #375:
URL: https://github.com/apache/incubator-tubemq/pull/375#discussion_r549636053



##########
File path: tubemq-manager/src/main/java/org/apache/tubemq/manager/service/NodeService.java
##########
@@ -413,4 +415,32 @@ public AddBrokerResult addBrokersToClusterWithId(AddBrokersReq req, NodeEntry ma
         }
         return null;
     }
+
+    public TubeMQResult cloneTopicToBrokers(CloneTopicReq req, NodeEntry master) throws Exception {
+
+        // 1 query topic config
+        TubeHttpTopicInfoList topicInfoList = requestTopicConfigInfo(master, req.getSourceTopicName());
+
+        if (topicInfoList == null) {
+            return TubeMQResult.getErrorResult("no such topic");
+        }
+
+        // 2 if there's no specific broker ids then clone to all of the brokers
+        List<Integer> brokerId = req.getBrokerId();
+
+        if (CollectionUtils.isEmpty(brokerId)) {
+            TubeHttpBrokerInfoList brokerInfoList = requestClusterNodeStatus(master);
+            if (brokerInfoList != null) {
+                brokerId = brokerInfoList.getAllBrokerIdList();

Review comment:
       done
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org