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/10/18 08:44:58 UTC

[GitHub] [inlong] GanfengTan commented on a diff in pull request #6184: [INLONG-6181][Agent][DataProxy][Manager] Support node protocol reporting and query

GanfengTan commented on code in PR #6184:
URL: https://github.com/apache/inlong/pull/6184#discussion_r997907438


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/heartbeat/HeartbeatManager.java:
##########
@@ -97,26 +99,36 @@ public void reportHeartbeat(HeartbeatMsg heartbeat) {
 
         // if the heartbeat was not in the cache, insert or update the node by the heartbeat info
         HeartbeatMsg lastHeartbeat = heartbeatCache.getIfPresent(componentHeartbeat);
-        boolean exist = true;
-        int updateNum = UPDATE_ZERO_ROW;
-        if (lastHeartbeat == null) {
-            exist = false;
-            InlongClusterNodeEntity clusterNode = getClusterNode(clusterInfo, heartbeat);
-            if (clusterNode == null) {
-                updateNum = insertClusterNode(clusterInfo, heartbeat, clusterInfo.getCreator());
-                log.info("insert node result: {}", updateNum);
-            } else {
-                updateNum = updateClusterNode(clusterNode);
-                log.info("update node result: {}", updateNum);
+        String[] ports = heartbeat.getPort().split(InlongConstants.COMMA);
+        String protocolType = heartbeat.getProtocolType();
+        String[] protocolTypes = StringUtils.isNoneBlank(protocolType) && ports.length > 1
+                ? heartbeat.getProtocolType().split(InlongConstants.COMMA) : null;
+        int handlerNum = 0;
+        for (int i = 0; i < ports.length; i++) {
+            HeartbeatMsg heartbeatMsg = OBJECT_MAPPER.readValue(

Review Comment:
   https://github.com/apache/inlong/pull/6184/commits/9c88ea1bba0c93c3eba399f38c58bdf8b6330ebf



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