You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by wa...@apache.org on 2024/03/20 08:53:20 UTC
(inlong) branch INLONG-9856 created (now 1565e088d9)
This is an automated email from the ASF dual-hosted git repository.
wakefu pushed a change to branch INLONG-9856
in repository https://gitbox.apache.org/repos/asf/inlong.git
at 1565e088d9 [INLONG-9856][Manager] Missing tenant information when listTag
This branch includes the following new commits:
new 1565e088d9 [INLONG-9856][Manager] Missing tenant information when listTag
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(inlong) 01/01: [INLONG-9856][Manager] Missing tenant information when listTag
Posted by wa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
wakefu pushed a commit to branch INLONG-9856
in repository https://gitbox.apache.org/repos/asf/inlong.git
commit 1565e088d93ecbdc6015bf751544a92e08252f50
Author: fuwenkai <83...@qq.com>
AuthorDate: Wed Mar 20 16:53:11 2024 +0800
[INLONG-9856][Manager] Missing tenant information when listTag
---
.../service/cluster/InlongClusterServiceImpl.java | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterServiceImpl.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterServiceImpl.java
index 2c62c5a35c..3733318817 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterServiceImpl.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterServiceImpl.java
@@ -230,7 +230,15 @@ public class InlongClusterServiceImpl implements InlongClusterService {
throw new BusinessException(ErrorCodeEnum.CLUSTER_NOT_FOUND,
String.format("inlong cluster tag not found by id=%s", id));
}
- return CommonBeanUtils.copyProperties(entity, ClusterTagResponse::new);
+ ClusterTagResponse response = CommonBeanUtils.copyProperties(entity, ClusterTagResponse::new);
+ List<String> tenantList = tenantClusterTagMapper
+ .selectByTag(entity.getClusterTag()).stream()
+ .map(TenantClusterTagEntity::getTenant)
+ .collect(Collectors.toList());
+ response.setTenantList(tenantList);
+
+ LOGGER.debug("success to get cluster tag info by id={}", id);
+ return response;
}
@Override
@@ -239,7 +247,15 @@ public class InlongClusterServiceImpl implements InlongClusterService {
Page<InlongClusterTagEntity> entityPage = (Page<InlongClusterTagEntity>) clusterTagMapper
.selectByCondition(request);
PageResult<ClusterTagResponse> pageResult = PageResult.fromPage(entityPage)
- .map(entity -> CommonBeanUtils.copyProperties(entity, ClusterTagResponse::new));
+ .map(entity -> {
+ ClusterTagResponse response = CommonBeanUtils.copyProperties(entity, ClusterTagResponse::new);
+ List<String> tenantList = tenantClusterTagMapper
+ .selectByTag(entity.getClusterTag()).stream()
+ .map(TenantClusterTagEntity::getTenant)
+ .collect(Collectors.toList());
+ response.setTenantList(tenantList);
+ return response;
+ });
LOGGER.debug("success to list cluster tag by {}", request);
return pageResult;