haibo-duan commented on code in PR #5332:
URL: https://github.com/apache/inlong/pull/5332#discussion_r936337763


##########
inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/HeartbeatManager.java:
##########
@@ -70,13 +88,65 @@ public HeartbeatManager(AgentManager agentManager) {
         jobmanager = agentManager.getJobManager();
         httpManager = new HttpManager(conf);
         baseManagerUrl = buildBaseUrl();
-        reportSnapshotUrl = builReportSnapShotUrl(baseManagerUrl);
+        reportSnapshotUrl = buildReportSnapShotUrl(baseManagerUrl);
+        reportHeartbeatUrl = buildReportHeartbeatUrl();
+    }
+
+    @Override
+    public void start() throws Exception {
+        submitWorker(snapshotReportThread());
+        submitWorker(heartbeatReportThread());
+    }
+
+    private Runnable snapshotReportThread() {
+        return () -> {
+            while (isRunnable()) {
+                try {
+                    TaskSnapshotRequest taskSnapshotRequest = 
buildTaskSnapshotRequest();
+                    httpManager.doSentPost(reportSnapshotUrl, 
taskSnapshotRequest);
+                    if (LOGGER.isDebugEnabled()) {
+                        LOGGER.debug(" {} report to manager", 
taskSnapshotRequest);
+                    }
+                    int heartbeatInterval = 
conf.getInt(AGENT_HEARTBEAT_INTERVAL,

Review Comment:
   the variable 'heartbeatInterval' is only used once. I don't think it is 
necessary to define the 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: [email protected]

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

Reply via email to