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/08/25 08:32:38 UTC

[GitHub] [inlong] healchow commented on a diff in pull request #5699: [INLONG-5698][Manager] Fixed the DataProxy cluster tag was restored after the manager was restarted

healchow commented on code in PR #5699:
URL: https://github.com/apache/inlong/pull/5699#discussion_r954666592


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/heartbeat/HeartbeatManager.java:
##########
@@ -158,12 +157,11 @@ private ClusterInfo fetchCluster(ComponentHeartbeat componentHeartbeat) {
         final String clusterName = componentHeartbeat.getClusterName();
         final String type = componentHeartbeat.getComponentType();
         final String clusterTag = componentHeartbeat.getClusterTag();
-        List<InlongClusterEntity> entities = clusterMapper.selectByKey(clusterTag, clusterName, type);
-        if (CollectionUtils.isNotEmpty(entities)) {
+        InlongClusterEntity entity = clusterMapper.selectByNameAndType(clusterName, type);
+        if (!Objects.isNull(entity)) {

Review Comment:
   Just call `if (null != entity)`.



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