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


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/HeartbeatServiceImpl.java:
##########
@@ -69,27 +71,36 @@ public class HeartbeatServiceImpl implements 
HeartbeatService {
     private StreamHeartbeatEntityMapper streamHeartbeatMapper;
 
     @Override
-    public Boolean reportHeartbeat(HeartbeatReportRequest request) {
-        if (request == null || 
StringUtils.isBlank(request.getComponentType())) {
-            log.warn("request is null or component null, just return");
+    public Boolean reportHeartbeat(List<HeartbeatReportRequest> requests) {
+        if (requests == null || requests.isEmpty()) {
             return false;
         }
-        if (log.isDebugEnabled()) {
-            log.debug("received heartbeat: " + request);
-        }
-        heartbeatManager.reportHeartbeat(request);
-        ComponentTypeEnum componentType = 
ComponentTypeEnum.forName(request.getComponentType());
-        switch (componentType) {
-            case Sort:
-            case DataProxy:
-            case Agent:
-            case Cache:
-            case SDK:
-                return updateHeartbeatOpt(request);
-            default:
-                log.error("Unsupported componentType={} for Inlong", 
componentType);
-                return false;
+        List<HeartbeatMsg> heartbeatMsgs = new ArrayList<>();
+        for (HeartbeatReportRequest request : requests) {
+            if (request == null || 
StringUtils.isBlank(request.getComponentType())) {
+                log.warn("request is null or component null, just return");
+                continue;
+            }
+            if (log.isDebugEnabled()) {
+                log.debug("received heartbeat: " + request);
+            }
+            heartbeatMsgs.add(request);
+            ComponentTypeEnum componentType = 
ComponentTypeEnum.forName(request.getComponentType());
+            switch (componentType) {
+                case Sort:
+                case DataProxy:
+                case Agent:
+                case Cache:
+                case SDK:

Review Comment:
   Has been rolled back to previous logic.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to