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/07/28 06:11:29 UTC

[GitHub] [inlong] healchow commented on a diff in pull request #5247: [INLONG-5246][Manager] Return all cluster nodes under the same cluster tag and type to the agent

healchow commented on code in PR #5247:
URL: https://github.com/apache/inlong/pull/5247#discussion_r931817231


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterServiceImpl.java:
##########
@@ -635,19 +635,20 @@ public DataProxyNodeResponse getDataProxyNodes(String inlongGroupId) {
         // if more than one data proxy cluster, currently takes first
         // TODO consider the data proxy load and re-balance
         InlongClusterEntity clusterEntity = clusterList.get(0);
-        Integer clusterId = clusterEntity.getId();
-        List<InlongClusterNodeEntity> nodeList = clusterNodeMapper.selectByParentId(clusterId);
         List<DataProxyNodeInfo> nodeInfos = new ArrayList<>();
-        for (InlongClusterNodeEntity nodeEntity : nodeList) {
-            DataProxyNodeInfo nodeInfo = new DataProxyNodeInfo();
-            nodeInfo.setId(nodeEntity.getId());
-            nodeInfo.setIp(nodeEntity.getIp());
-            nodeInfo.setPort(nodeEntity.getPort());
-            nodeInfos.add(nodeInfo);
+        for (InlongClusterEntity entity : clusterList) {
+            List<InlongClusterNodeEntity> nodeList = clusterNodeMapper.selectByParentId(entity.getId());
+            for (InlongClusterNodeEntity nodeEntity : nodeList) {
+                DataProxyNodeInfo nodeInfo = new DataProxyNodeInfo();
+                nodeInfo.setId(nodeEntity.getId());
+                nodeInfo.setIp(nodeEntity.getIp());
+                nodeInfo.setPort(nodeEntity.getPort());
+                nodeInfos.add(nodeInfo);
+            }
         }
 
         DataProxyNodeResponse response = new DataProxyNodeResponse();
-        response.setClusterId(clusterId);
+        response.setClusterId(clusterEntity.getId());

Review Comment:
   Just change to `response.setClusterId(clusterList.get(0).getId());`.



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