GanfengTan commented on code in PR #6184:
URL: https://github.com/apache/inlong/pull/6184#discussion_r997751319
##########
inlong-dataproxy/dataproxy-docker/dataproxy-docker.sh:
##########
@@ -29,6 +32,17 @@ sed -i
"s/proxy.cluster.tag=.*$/proxy.cluster.tag=${CLUSTER_TAG}/g" "${common_co
sed -i "s/proxy.cluster.name=.*$/proxy.cluster.name=${CLUSTER_NAME}/g"
"${common_conf_file}"
sed -i
"s/proxy.cluster.inCharges=.*$/proxy.cluster.inCharges=${CLUSTER_IN_CHARGES}/g"
"${common_conf_file}"
+if [ "${PROTOCOL_HTTP}" = "http" ]; then
+ echo "proxy.report.http.protocol=${PROTOCOL_HTTP}" >> "${common_conf_file}"
+ if [ "${MQ_TYPE}" = "tubemq" ]; then
+ sed -i "s/agent1.sources=.*$/agent1.sources=tcp-source http-source/g"
"${tube_conf_file}"
+ sed -n '29~49p' ${http_conf_file} >> ${tube_conf_file}
+ else
Review Comment:
Has been removed.
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/heartbeat/HeartbeatManager.java:
##########
@@ -97,26 +99,35 @@ 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;
+ for (int i = 0; i < ports.length; i++) {
+ HeartbeatMsg heartbeatMsg = OBJECT_MAPPER.readValue(
+ OBJECT_MAPPER.writeValueAsBytes(heartbeat),
HeartbeatMsg.class);
+ heartbeatMsg.setPort(ports[i].trim());
+ heartbeatMsg.setProtocolType(protocolType);
+ if (protocolTypes != null) {
+ heartbeatMsg.setProtocolType(protocolTypes[i]);
+ }
+ if (lastHeartbeat == null) {
+ InlongClusterNodeEntity clusterNode =
getClusterNode(clusterInfo, heartbeatMsg);
+ if (clusterNode == null) {
+ insertClusterNode(clusterInfo, heartbeatMsg,
clusterInfo.getCreator());
+ } else {
+ updateClusterNode(clusterNode);
Review Comment:
done
--
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]