You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/03/21 11:34:58 UTC

[GitHub] [incubator-inlong] bluewang opened a new pull request #3273: [INLONG-3201] [TubeMQ] Improve the cluster query function

bluewang opened a new pull request #3273:
URL: https://github.com/apache/incubator-inlong/pull/3273


   ### Title Name: [INLONG-XYZ][component] Title of the pull request
   
   where *XYZ* should be replaced by the actual issue number.
   
   Fixes https://github.com/apache/incubator-inlong/issues/3201
   
   ### Motivation
   
   *Explain here the context, and why you're making that change. What is the problem you're trying to solve.*
   
   ### Modifications
   
   *Describe the modifications you've done.*
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
   


-- 
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: commits-unsubscribe@inlong.apache.org

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



[GitHub] [incubator-inlong] EMsnap commented on a change in pull request #3273: [INLONG-3201][TubeMQ] Improve the cluster query function

Posted by GitBox <gi...@apache.org>.
EMsnap commented on a change in pull request #3273:
URL: https://github.com/apache/incubator-inlong/pull/3273#discussion_r831808681



##########
File path: inlong-tubemq/tubemq-manager/src/main/java/org/apache/inlong/tubemq/manager/controller/cluster/ClusterController.java
##########
@@ -185,4 +190,121 @@ String queryInfo(
         return masterService.queryMaster(url);
     }
 
+    /**
+     * get all count
+     * @param clusterId
+     * @return
+     */
+    public ClusterVo getAllCount(Integer clusterId) {
+        ClusterVo clusterVo = new ClusterVo();
+        int brokerSize = getBrokerSize(clusterId);
+        ClusterVo countVo = getTopicAndPartitionCount(clusterId);
+        int consumerGroupCount = getConsumerGroupCount(clusterId);
+        int consumerCount = getConsumerCount(clusterId);
+        int storeCount = getStoreCount(clusterId);
+        clusterVo.setBrokerCount(brokerSize);
+        clusterVo.setTopicCount(countVo.getTopicCount());
+        clusterVo.setPartitionCount(countVo.getPartitionCount());
+        clusterVo.setConsumerGroupCount(consumerGroupCount);
+        clusterVo.setConsumerCount(consumerCount);
+        clusterVo.setStoreCount(storeCount);
+        return clusterVo;
+    }
+
+    /**
+     * query borker size
+     * @param clusterId
+     * @return
+     */
+    public int getBrokerSize(Integer clusterId) {
+        String queryUrl = masterService.getQueryCountUrl(clusterId, TubeConst.BROKER_RUN_STATUS);
+        String s = masterService.queryMaster(queryUrl);

Review comment:
       pls make a name that's readable

##########
File path: inlong-tubemq/tubemq-manager/src/main/java/org/apache/inlong/tubemq/manager/controller/cluster/ClusterController.java
##########
@@ -185,4 +190,121 @@ String queryInfo(
         return masterService.queryMaster(url);
     }
 
+    /**
+     * get all count
+     * @param clusterId
+     * @return
+     */
+    public ClusterVo getAllCount(Integer clusterId) {
+        ClusterVo clusterVo = new ClusterVo();
+        int brokerSize = getBrokerSize(clusterId);
+        ClusterVo countVo = getTopicAndPartitionCount(clusterId);
+        int consumerGroupCount = getConsumerGroupCount(clusterId);
+        int consumerCount = getConsumerCount(clusterId);
+        int storeCount = getStoreCount(clusterId);
+        clusterVo.setBrokerCount(brokerSize);
+        clusterVo.setTopicCount(countVo.getTopicCount());
+        clusterVo.setPartitionCount(countVo.getPartitionCount());
+        clusterVo.setConsumerGroupCount(consumerGroupCount);
+        clusterVo.setConsumerCount(consumerCount);
+        clusterVo.setStoreCount(storeCount);
+        return clusterVo;
+    }
+
+    /**
+     * query borker size
+     * @param clusterId
+     * @return
+     */
+    public int getBrokerSize(Integer clusterId) {
+        String queryUrl = masterService.getQueryCountUrl(clusterId, TubeConst.BROKER_RUN_STATUS);
+        String s = masterService.queryMaster(queryUrl);
+        JsonObject jsonObject = gson.fromJson(s, JsonObject.class);
+        JsonElement count = jsonObject.get("count");
+        return gson.fromJson(count, int.class);
+    }
+
+    /**
+     * query topic and partition count
+     * @param clusterId
+     * @return
+     */
+    public ClusterVo getTopicAndPartitionCount(Integer clusterId) {
+        ClusterVo clusterVo = new ClusterVo();
+        String url = masterService.getQueryCountUrl(clusterId, TubeConst.TOPIC_CONFIG_INFO);
+        String s = masterService.queryMaster(url);
+        JsonObject jsonObject = gson.fromJson(s, JsonObject.class);
+        JsonElement data = jsonObject.get("data");
+        JsonElement dataCount = jsonObject.get("dataCount");
+        Integer topicSize = gson.fromJson(dataCount, Integer.class);
+        List<Map> list = gson.fromJson(data, List.class);
+        int partitionCount = 0;
+        for (Map map : list) {
+            Double totalRunNumPartCount = Double.valueOf(map.get("totalRunNumPartCount").toString());
+            partitionCount = partitionCount + (int)Math.ceil(totalRunNumPartCount);
+        }
+        clusterVo.setTopicCount(topicSize);
+        clusterVo.setPartitionCount(partitionCount);
+        return clusterVo;
+    }
+
+    /**
+     * query Consumer group count
+     * @param clusterId
+     * @return
+     */
+    public int getConsumerGroupCount(Integer clusterId) {
+        String queryUrl = masterService.getQueryCountUrl(clusterId, TubeConst.QUERY_CONSUMER_GROUP_INFO);
+        int consumerGroupCount = 0;
+        String groupData = masterService.queryMaster(queryUrl);
+        JsonObject jsonObject1 = gson.fromJson(groupData, JsonObject.class);
+        JsonElement data1 = jsonObject1.get("data");
+        JsonArray jsonElements1 = gson.fromJson(data1, JsonArray.class);
+        for (JsonElement jsonElement : jsonElements1) {
+            Map map1 = gson.fromJson(jsonElement, Map.class);
+            Double groupCount = Double.valueOf(map1.get("groupCount").toString());
+            consumerGroupCount = consumerGroupCount + (int)Math.ceil(groupCount);
+        }
+        return consumerGroupCount;
+    }
+
+    /**
+     * query consumer count
+     * @param clusterId
+     * @return
+     */
+    public int getConsumerCount(Integer clusterId) {
+        String queryUrl = masterService.getQueryCountUrl(clusterId, TubeConst.QUERY_CONSUMER_INFO);
+        String queryMaster = masterService.queryMaster(queryUrl);
+        JsonObject jsonObject = gson.fromJson(queryMaster, JsonObject.class);
+        JsonElement data = jsonObject.get("data");
+        JsonArray jsonData = gson.fromJson(data, JsonArray.class);
+        int consumerCount = 0;
+        for (JsonElement jsonDatum : jsonData) {
+            Map map1 = gson.fromJson(jsonDatum, Map.class);

Review comment:
       invalid variable name

##########
File path: inlong-tubemq/tubemq-manager/src/main/java/org/apache/inlong/tubemq/manager/controller/cluster/ClusterController.java
##########
@@ -185,4 +190,121 @@ String queryInfo(
         return masterService.queryMaster(url);
     }
 
+    /**
+     * get all count
+     * @param clusterId
+     * @return
+     */
+    public ClusterVo getAllCount(Integer clusterId) {
+        ClusterVo clusterVo = new ClusterVo();
+        int brokerSize = getBrokerSize(clusterId);
+        ClusterVo countVo = getTopicAndPartitionCount(clusterId);
+        int consumerGroupCount = getConsumerGroupCount(clusterId);
+        int consumerCount = getConsumerCount(clusterId);
+        int storeCount = getStoreCount(clusterId);
+        clusterVo.setBrokerCount(brokerSize);
+        clusterVo.setTopicCount(countVo.getTopicCount());
+        clusterVo.setPartitionCount(countVo.getPartitionCount());
+        clusterVo.setConsumerGroupCount(consumerGroupCount);
+        clusterVo.setConsumerCount(consumerCount);
+        clusterVo.setStoreCount(storeCount);
+        return clusterVo;
+    }
+
+    /**
+     * query borker size
+     * @param clusterId
+     * @return
+     */
+    public int getBrokerSize(Integer clusterId) {
+        String queryUrl = masterService.getQueryCountUrl(clusterId, TubeConst.BROKER_RUN_STATUS);
+        String s = masterService.queryMaster(queryUrl);
+        JsonObject jsonObject = gson.fromJson(s, JsonObject.class);
+        JsonElement count = jsonObject.get("count");
+        return gson.fromJson(count, int.class);
+    }
+
+    /**
+     * query topic and partition count
+     * @param clusterId
+     * @return
+     */
+    public ClusterVo getTopicAndPartitionCount(Integer clusterId) {
+        ClusterVo clusterVo = new ClusterVo();
+        String url = masterService.getQueryCountUrl(clusterId, TubeConst.TOPIC_CONFIG_INFO);
+        String s = masterService.queryMaster(url);
+        JsonObject jsonObject = gson.fromJson(s, JsonObject.class);
+        JsonElement data = jsonObject.get("data");
+        JsonElement dataCount = jsonObject.get("dataCount");
+        Integer topicSize = gson.fromJson(dataCount, Integer.class);
+        List<Map> list = gson.fromJson(data, List.class);
+        int partitionCount = 0;
+        for (Map map : list) {
+            Double totalRunNumPartCount = Double.valueOf(map.get("totalRunNumPartCount").toString());
+            partitionCount = partitionCount + (int)Math.ceil(totalRunNumPartCount);
+        }
+        clusterVo.setTopicCount(topicSize);
+        clusterVo.setPartitionCount(partitionCount);
+        return clusterVo;
+    }
+
+    /**
+     * query Consumer group count
+     * @param clusterId
+     * @return
+     */
+    public int getConsumerGroupCount(Integer clusterId) {
+        String queryUrl = masterService.getQueryCountUrl(clusterId, TubeConst.QUERY_CONSUMER_GROUP_INFO);
+        int consumerGroupCount = 0;
+        String groupData = masterService.queryMaster(queryUrl);
+        JsonObject jsonObject1 = gson.fromJson(groupData, JsonObject.class);
+        JsonElement data1 = jsonObject1.get("data");
+        JsonArray jsonElements1 = gson.fromJson(data1, JsonArray.class);
+        for (JsonElement jsonElement : jsonElements1) {
+            Map map1 = gson.fromJson(jsonElement, Map.class);
+            Double groupCount = Double.valueOf(map1.get("groupCount").toString());
+            consumerGroupCount = consumerGroupCount + (int)Math.ceil(groupCount);
+        }
+        return consumerGroupCount;
+    }
+
+    /**
+     * query consumer count
+     * @param clusterId
+     * @return
+     */
+    public int getConsumerCount(Integer clusterId) {
+        String queryUrl = masterService.getQueryCountUrl(clusterId, TubeConst.QUERY_CONSUMER_INFO);
+        String queryMaster = masterService.queryMaster(queryUrl);
+        JsonObject jsonObject = gson.fromJson(queryMaster, JsonObject.class);
+        JsonElement data = jsonObject.get("data");
+        JsonArray jsonData = gson.fromJson(data, JsonArray.class);
+        int consumerCount = 0;
+        for (JsonElement jsonDatum : jsonData) {
+            Map map1 = gson.fromJson(jsonDatum, Map.class);
+            Double groupCount = Double.valueOf(map1.get("consumerNum").toString());
+            consumerCount = (int)Math.ceil(groupCount);
+        }
+        return consumerCount;
+    }
+
+    /**
+     * query store count
+     * @param clusterId
+     * @return
+     */
+    public int getStoreCount(Integer clusterId) {
+        String queryUrl = masterService.getQueryCountUrl(clusterId, TubeConst.TOPIC_VIEW);
+        JsonObject jsonObject = gson.fromJson(masterService.queryMaster(queryUrl), JsonObject.class);
+        JsonElement getData = jsonObject.get("data");
+        JsonArray jsonData = gson.fromJson(getData, JsonArray.class);
+        int storeCount = 0;
+        for (JsonElement jsonDatum : jsonData) {
+            Map map1 = gson.fromJson(jsonDatum, Map.class);

Review comment:
       DITTO

##########
File path: inlong-tubemq/tubemq-manager/src/main/java/org/apache/inlong/tubemq/manager/controller/cluster/ClusterController.java
##########
@@ -185,4 +190,121 @@ String queryInfo(
         return masterService.queryMaster(url);
     }
 
+    /**
+     * get all count
+     * @param clusterId
+     * @return
+     */
+    public ClusterVo getAllCount(Integer clusterId) {
+        ClusterVo clusterVo = new ClusterVo();
+        int brokerSize = getBrokerSize(clusterId);
+        ClusterVo countVo = getTopicAndPartitionCount(clusterId);
+        int consumerGroupCount = getConsumerGroupCount(clusterId);
+        int consumerCount = getConsumerCount(clusterId);
+        int storeCount = getStoreCount(clusterId);
+        clusterVo.setBrokerCount(brokerSize);
+        clusterVo.setTopicCount(countVo.getTopicCount());
+        clusterVo.setPartitionCount(countVo.getPartitionCount());
+        clusterVo.setConsumerGroupCount(consumerGroupCount);
+        clusterVo.setConsumerCount(consumerCount);
+        clusterVo.setStoreCount(storeCount);
+        return clusterVo;
+    }
+
+    /**
+     * query borker size
+     * @param clusterId
+     * @return
+     */
+    public int getBrokerSize(Integer clusterId) {
+        String queryUrl = masterService.getQueryCountUrl(clusterId, TubeConst.BROKER_RUN_STATUS);
+        String s = masterService.queryMaster(queryUrl);
+        JsonObject jsonObject = gson.fromJson(s, JsonObject.class);
+        JsonElement count = jsonObject.get("count");
+        return gson.fromJson(count, int.class);
+    }
+
+    /**
+     * query topic and partition count
+     * @param clusterId
+     * @return
+     */
+    public ClusterVo getTopicAndPartitionCount(Integer clusterId) {
+        ClusterVo clusterVo = new ClusterVo();
+        String url = masterService.getQueryCountUrl(clusterId, TubeConst.TOPIC_CONFIG_INFO);
+        String s = masterService.queryMaster(url);
+        JsonObject jsonObject = gson.fromJson(s, JsonObject.class);
+        JsonElement data = jsonObject.get("data");
+        JsonElement dataCount = jsonObject.get("dataCount");
+        Integer topicSize = gson.fromJson(dataCount, Integer.class);
+        List<Map> list = gson.fromJson(data, List.class);
+        int partitionCount = 0;
+        for (Map map : list) {
+            Double totalRunNumPartCount = Double.valueOf(map.get("totalRunNumPartCount").toString());
+            partitionCount = partitionCount + (int)Math.ceil(totalRunNumPartCount);
+        }
+        clusterVo.setTopicCount(topicSize);
+        clusterVo.setPartitionCount(partitionCount);
+        return clusterVo;
+    }
+
+    /**
+     * query Consumer group count
+     * @param clusterId
+     * @return
+     */
+    public int getConsumerGroupCount(Integer clusterId) {
+        String queryUrl = masterService.getQueryCountUrl(clusterId, TubeConst.QUERY_CONSUMER_GROUP_INFO);
+        int consumerGroupCount = 0;
+        String groupData = masterService.queryMaster(queryUrl);
+        JsonObject jsonObject1 = gson.fromJson(groupData, JsonObject.class);
+        JsonElement data1 = jsonObject1.get("data");
+        JsonArray jsonElements1 = gson.fromJson(data1, JsonArray.class);
+        for (JsonElement jsonElement : jsonElements1) {
+            Map map1 = gson.fromJson(jsonElement, Map.class);
+            Double groupCount = Double.valueOf(map1.get("groupCount").toString());
+            consumerGroupCount = consumerGroupCount + (int)Math.ceil(groupCount);
+        }
+        return consumerGroupCount;
+    }
+
+    /**
+     * query consumer count
+     * @param clusterId
+     * @return
+     */
+    public int getConsumerCount(Integer clusterId) {
+        String queryUrl = masterService.getQueryCountUrl(clusterId, TubeConst.QUERY_CONSUMER_INFO);
+        String queryMaster = masterService.queryMaster(queryUrl);
+        JsonObject jsonObject = gson.fromJson(queryMaster, JsonObject.class);
+        JsonElement data = jsonObject.get("data");
+        JsonArray jsonData = gson.fromJson(data, JsonArray.class);
+        int consumerCount = 0;
+        for (JsonElement jsonDatum : jsonData) {
+            Map map1 = gson.fromJson(jsonDatum, Map.class);

Review comment:
       create a pojo for map 




-- 
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: commits-unsubscribe@inlong.apache.org

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



[GitHub] [incubator-inlong] healchow commented on a change in pull request #3273: [INLONG-3201][TubeMQ] Improve the cluster query function

Posted by GitBox <gi...@apache.org>.
healchow commented on a change in pull request #3273:
URL: https://github.com/apache/incubator-inlong/pull/3273#discussion_r831703511



##########
File path: inlong-tubemq/tubemq-manager/src/main/java/org/apache/inlong/tubemq/manager/controller/cluster/ClusterController.java
##########
@@ -185,4 +190,121 @@ String queryInfo(
         return masterService.queryMaster(url);
     }
 
+    /**
+     * get all count
+     * @param clusterId
+     * @return
+     */
+    public ClusterVo getAllCount(Integer clusterId) {
+        ClusterVo clusterVo = new ClusterVo();
+        int brokerSize = getBrokerSize(clusterId);
+        ClusterVo countVo = getTopicAndPartitionCount(clusterId);
+        int consumerGroupCount = getConsumerGroupCount(clusterId);
+        int consumerCount = getConsumerCount(clusterId);
+        int storeCount = getStoreCount(clusterId);
+        clusterVo.setBrokerCount(brokerSize);
+        clusterVo.setTopicCount(countVo.getTopicCount());
+        clusterVo.setPartitionCount(countVo.getPartitionCount());
+        clusterVo.setConsumerGroupCount(consumerGroupCount);
+        clusterVo.setConsumerCount(consumerCount);
+        clusterVo.setStoreCount(storeCount);
+        return clusterVo;
+    }
+
+    /**
+     * query borker size
+     * @param clusterId
+     * @return
+     */
+    public int getBrokerSize(Integer clusterId) {
+        String queryUrl = masterService.getQueryCountUrl(clusterId, TubeConst.BROKER_RUN_STATUS);
+        String s = masterService.queryMaster(queryUrl);
+        JsonObject jsonObject = gson.fromJson(s, JsonObject.class);
+        JsonElement count = jsonObject.get("count");
+        return gson.fromJson(count, int.class);
+    }
+
+    /**
+     * query topic and partition count
+     * @param clusterId
+     * @return
+     */
+    public ClusterVo getTopicAndPartitionCount(Integer clusterId) {
+        ClusterVo clusterVo = new ClusterVo();
+        String url = masterService.getQueryCountUrl(clusterId, TubeConst.TOPIC_CONFIG_INFO);
+        String s = masterService.queryMaster(url);
+        JsonObject jsonObject = gson.fromJson(s, JsonObject.class);
+        JsonElement data = jsonObject.get("data");
+        JsonElement dataCount = jsonObject.get("dataCount");
+        Integer topicSize = gson.fromJson(dataCount, Integer.class);
+        List<Map> list = gson.fromJson(data, List.class);

Review comment:
       Its recommended to use a Java POJO class to instead of a Map.




-- 
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: commits-unsubscribe@inlong.apache.org

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



[GitHub] [incubator-inlong] healchow commented on a change in pull request #3273: [INLONG-3201][TubeMQ] Improve the cluster query function

Posted by GitBox <gi...@apache.org>.
healchow commented on a change in pull request #3273:
URL: https://github.com/apache/incubator-inlong/pull/3273#discussion_r832798896



##########
File path: inlong-tubemq/tubemq-manager/src/main/java/org/apache/inlong/tubemq/manager/controller/cluster/ClusterController.java
##########
@@ -179,10 +189,130 @@ public TubeMQResult deleteCluster(DeleteClusterReq req) {
     @RequestMapping(value = "/query", method = RequestMethod.GET,
             produces = MediaType.APPLICATION_JSON_VALUE)
     public @ResponseBody
-        String queryInfo(
+    String queryInfo(
             @RequestParam Map<String, String> queryBody) throws Exception {
         String url = masterService.getQueryUrl(queryBody);
         return masterService.queryMaster(url);
     }
 
+    /**
+     * get all count
+     *
+     * @param clusterId
+     */
+    public ClusterVo getAllCount(Integer clusterId) {
+        ClusterVo clusterVo = new ClusterVo();
+        int brokerSize = getBrokerSize(clusterId);
+        ClusterVo countVo = getTopicAndPartitionCount(clusterId);
+        int consumerGroupCount = getConsumerGroupCount(clusterId);
+        int consumerCount = getConsumerCount(clusterId);
+        int storeCount = getStoreCount(clusterId);
+        clusterVo.setBrokerCount(brokerSize);
+        clusterVo.setTopicCount(countVo.getTopicCount());
+        clusterVo.setPartitionCount(countVo.getPartitionCount());
+        clusterVo.setConsumerGroupCount(consumerGroupCount);
+        clusterVo.setConsumerCount(consumerCount);
+        clusterVo.setStoreCount(storeCount);
+        return clusterVo;
+    }
+
+    /**
+     * query borker size
+     *
+     * @param clusterId
+     */
+    public int getBrokerSize(Integer clusterId) {
+        String queryUrl = masterService.getQueryCountUrl(clusterId, TubeConst.BROKER_RUN_STATUS);
+        String queryData = masterService.queryMaster(queryUrl);
+        JsonObject jsonObject = gson.fromJson(queryData, JsonObject.class);
+        JsonElement count = jsonObject.get("count");
+        return gson.fromJson(count, int.class);
+    }
+
+    /**
+     * query topic and partition count
+     *
+     * @param clusterId
+     */
+    public ClusterVo getTopicAndPartitionCount(Integer clusterId) {
+        ClusterVo clusterVo = new ClusterVo();
+        String url = masterService.getQueryCountUrl(clusterId, TubeConst.TOPIC_CONFIG_INFO);
+        String queryMaster = masterService.queryMaster(url);
+        JsonObject jsonObject = gson.fromJson(queryMaster, JsonObject.class);
+        JsonElement data = jsonObject.get("data");
+        JsonElement dataCount = jsonObject.get("dataCount");
+        Integer topicSize = gson.fromJson(dataCount, Integer.class);
+        JsonArray jsonData = gson.fromJson(data, JsonArray.class);
+        int partitionCount = 0;
+        List<TopicQueryRes> topicQueryResList = gson.fromJson(jsonData.toString(),
+                new TypeToken<List<TopicQueryRes>>() {
+                }.getType());
+        for (TopicQueryRes topicQueryRes : topicQueryResList) {
+            String totalCfgNumPart = topicQueryRes.getTotalCfgNumPart();
+            partitionCount = partitionCount + (int) Math.ceil(Double.parseDouble(totalCfgNumPart));
+        }
+        clusterVo.setTopicCount(topicSize);
+        clusterVo.setPartitionCount(partitionCount);
+        return clusterVo;
+    }
+
+    /**
+     * query Consumer group count
+     *
+     * @param clusterId
+     * @return
+     */
+    public int getConsumerGroupCount(Integer clusterId) {
+        String queryUrl = masterService.getQueryCountUrl(clusterId, TubeConst.QUERY_CONSUMER_GROUP_INFO);
+        int consumerGroupCount = 0;
+        String groupData = masterService.queryMaster(queryUrl);
+        JsonObject jsonObject1 = gson.fromJson(groupData, JsonObject.class);

Review comment:
       Why add 1 for this variable?




-- 
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: commits-unsubscribe@inlong.apache.org

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



[GitHub] [incubator-inlong] EMsnap merged pull request #3273: [INLONG-3201][TubeMQ] Improve the cluster query function

Posted by GitBox <gi...@apache.org>.
EMsnap merged pull request #3273:
URL: https://github.com/apache/incubator-inlong/pull/3273


   


-- 
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: commits-unsubscribe@inlong.apache.org

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