leosanqing commented on code in PR #5332:
URL: https://github.com/apache/inlong/pull/5332#discussion_r936781410
##########
inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/HeartbeatManager.java:
##########
@@ -106,6 +176,50 @@ private TaskSnapshotRequest getHeartBeat() {
return taskSnapshotRequest;
}
+ /**
+ * build heartbeat message of agent
+ */
+ private HeartbeatMsg buildHeartbeatMsg() {
+ HeartbeatMsg heartbeatMsg = new HeartbeatMsg();
+ final String agentIp = AgentUtils.fetchLocalIp();
+ final int agentPort = conf.getInt(AGENT_HTTP_PORT,
DEFAULT_AGENT_HTTP_PORT);
+ final String clusterName = conf.get(AGENT_CLUSTER_NAME);
+ final String clusterTag = conf.get(AGENT_CLUSTER_TAG);
+ heartbeatMsg.setIp(agentIp);
+ heartbeatMsg.setPort(agentPort);
+ heartbeatMsg.setComponentType(ComponentTypeEnum.Agent.getName());
+ heartbeatMsg.setReportTime(System.currentTimeMillis());
+ if (StringUtils.isNotBlank(clusterName)) {
+ heartbeatMsg.setClusterName(clusterName);
+ }
+ if (StringUtils.isNotBlank(clusterTag)) {
+ heartbeatMsg.setClusterTag(clusterTag);
+ }
+ Map<String, JobWrapper> jobWrapperMap = jobmanager.getJobs();
Review Comment:
Add a blank line to split the logic of building the jobWrapperMap and
setting the heartbeatMsg field
--
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]