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:11:14 UTC

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

EMsnap opened a new pull request #375:
URL: https://github.com/apache/incubator-tubemq/pull/375


   [TUBEMQ-487] add new feature clone topic + batch add topics


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



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

Posted by GitBox <gi...@apache.org>.
yuanboliu commented on a change in pull request #375:
URL: https://github.com/apache/incubator-tubemq/pull/375#discussion_r549629678



##########
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:
       make sure all brokers are in configurable status
   TubeHttpBrokerInfoList.getConfigurableBrokerIdList




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



[GitHub] [incubator-tubemq] codecov-io commented on pull request #375: [TUBEMQ-487] add new feature clone topic + batch add topics

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #375:
URL: https://github.com/apache/incubator-tubemq/pull/375#issuecomment-752024370


   # [Codecov](https://codecov.io/gh/apache/incubator-tubemq/pull/375?src=pr&el=h1) Report
   > Merging [#375](https://codecov.io/gh/apache/incubator-tubemq/pull/375?src=pr&el=desc) (eb18f8f) into [TUBEMQ-421](https://codecov.io/gh/apache/incubator-tubemq/commit/a380eb924c0c31306d5827f44dc0c13de45a809a?el=desc) (a380eb9) will **increase** coverage by `0.01%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-tubemq/pull/375/graphs/tree.svg?width=650&height=150&src=pr&token=1EUK92O9K2)](https://codecov.io/gh/apache/incubator-tubemq/pull/375?src=pr&el=tree)
   
   ```diff
   @@               Coverage Diff               @@
   ##             TUBEMQ-421    #375      +/-   ##
   ===============================================
   + Coverage          8.02%   8.03%   +0.01%     
   - Complexity          466     468       +2     
   ===============================================
     Files               249     249              
     Lines             27125   27125              
     Branches           4441    4441              
   ===============================================
   + Hits               2176    2179       +3     
   + Misses            24478   24476       -2     
   + Partials            471     470       -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-tubemq/pull/375?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [.../tubemq/corebase/policies/FlowCtrlRuleHandler.java](https://codecov.io/gh/apache/incubator-tubemq/pull/375/diff?src=pr&el=tree#diff-dHViZW1xLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3R1YmVtcS9jb3JlYmFzZS9wb2xpY2llcy9GbG93Q3RybFJ1bGVIYW5kbGVyLmphdmE=) | `44.57% <0.00%> (+0.58%)` | `35.00% <0.00%> (+1.00%)` | |
   | [.../apache/tubemq/corebase/policies/FlowCtrlItem.java](https://codecov.io/gh/apache/incubator-tubemq/pull/375/diff?src=pr&el=tree#diff-dHViZW1xLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3R1YmVtcS9jb3JlYmFzZS9wb2xpY2llcy9GbG93Q3RybEl0ZW0uamF2YQ==) | `40.00% <0.00%> (+1.11%)` | `9.00% <0.00%> (+1.00%)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-tubemq/pull/375?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-tubemq/pull/375?src=pr&el=footer). Last update [a380eb9...49b7200](https://codecov.io/gh/apache/incubator-tubemq/pull/375?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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



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

Posted by GitBox <gi...@apache.org>.
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



[GitHub] [incubator-tubemq] yuanboliu merged pull request #375: [TUBEMQ-487] add new feature clone topic + batch add topics

Posted by GitBox <gi...@apache.org>.
yuanboliu merged pull request #375:
URL: https://github.com/apache/incubator-tubemq/pull/375


   


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



[GitHub] [incubator-tubemq] codecov-io edited a comment on pull request #375: [TUBEMQ-487] add new feature clone topic + batch add topics

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #375:
URL: https://github.com/apache/incubator-tubemq/pull/375#issuecomment-752024370


   # [Codecov](https://codecov.io/gh/apache/incubator-tubemq/pull/375?src=pr&el=h1) Report
   > Merging [#375](https://codecov.io/gh/apache/incubator-tubemq/pull/375?src=pr&el=desc) (49b7200) into [TUBEMQ-421](https://codecov.io/gh/apache/incubator-tubemq/commit/a380eb924c0c31306d5827f44dc0c13de45a809a?el=desc) (a380eb9) will **decrease** coverage by `0.01%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-tubemq/pull/375/graphs/tree.svg?width=650&height=150&src=pr&token=1EUK92O9K2)](https://codecov.io/gh/apache/incubator-tubemq/pull/375?src=pr&el=tree)
   
   ```diff
   @@               Coverage Diff               @@
   ##             TUBEMQ-421    #375      +/-   ##
   ===============================================
   - Coverage          8.02%   8.00%   -0.02%     
   - Complexity          466     468       +2     
   ===============================================
     Files               249     249              
     Lines             27125   27125              
     Branches           4441    4441              
   ===============================================
   - Hits               2176    2172       -4     
   - Misses            24478   24482       +4     
     Partials            471     471              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-tubemq/pull/375?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [.../java/org/apache/flume/sink/tubemq/TubemqSink.java](https://codecov.io/gh/apache/incubator-tubemq/pull/375/diff?src=pr&el=tree#diff-dHViZW1xLWNvbm5lY3RvcnMvdHViZW1xLWNvbm5lY3Rvci1mbHVtZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZmx1bWUvc2luay90dWJlbXEvVHViZW1xU2luay5qYXZh) | `51.42% <0.00%> (-4.00%)` | `14.00% <0.00%> (ø%)` | |
   | [.../tubemq/corebase/policies/FlowCtrlRuleHandler.java](https://codecov.io/gh/apache/incubator-tubemq/pull/375/diff?src=pr&el=tree#diff-dHViZW1xLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3R1YmVtcS9jb3JlYmFzZS9wb2xpY2llcy9GbG93Q3RybFJ1bGVIYW5kbGVyLmphdmE=) | `44.57% <0.00%> (+0.58%)` | `35.00% <0.00%> (+1.00%)` | |
   | [.../apache/tubemq/corebase/policies/FlowCtrlItem.java](https://codecov.io/gh/apache/incubator-tubemq/pull/375/diff?src=pr&el=tree#diff-dHViZW1xLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3R1YmVtcS9jb3JlYmFzZS9wb2xpY2llcy9GbG93Q3RybEl0ZW0uamF2YQ==) | `40.00% <0.00%> (+1.11%)` | `9.00% <0.00%> (+1.00%)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-tubemq/pull/375?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-tubemq/pull/375?src=pr&el=footer). Last update [a380eb9...49b7200](https://codecov.io/gh/apache/incubator-tubemq/pull/375?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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