vernedeng commented on code in PR #8831:
URL: https://github.com/apache/inlong/pull/8831#discussion_r1314479098


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/tenant/InlongTenantServiceImpl.java:
##########
@@ -156,6 +167,32 @@ public Boolean delete(String name) {
         String operator = LoginUserUtils.getLoginUser().getName();
         log.info("begin to delete inlong tenant name={} by user={}", name, 
operator);
         InlongTenantEntity inlongTenantEntity = 
inlongTenantEntityMapper.selectByName(name);
+        // before deleting a tenant, check if all Groups of the tenant are in 
stop status
+        List<InlongGroupEntity> groupList = groupMapper.selectByTenant(name);
+        long notStopGroupCount =
+                groupList.stream().filter(
+                        group -> 
!GroupStatus.DELETED.getCode().equals(group.getStatus()) || 
group.getIsDeleted() == 0)
+                        .count();
+        if (notStopGroupCount > 0) {
+            String errMsg = String.format(

Review Comment:
   Please log out all groups that are not in stop or deleted status



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