Skip to content

Commit

Permalink
[INLONG-11751][Manager] Modify doDeleteCheck method verify (#11758)
Browse files Browse the repository at this point in the history
* [INLONG-11751][Manager] Modify doDeleteCheck method verify

* [INLONG-11751][Manager] Modify doDeleteCheck method verify

* Change to use constant instead of enum

Apply suggestions from code review

Co-authored-by: fuweng11 <76141879+fuweng11@users.noreply.github.com>

* Delete GroupMode enum import

* [INLONG-11751][Manager] Fix code format

* [INLONG-11751][Manager] Remove unused enum

* Update inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/group/InlongGroupServiceImpl.java

---------

Co-authored-by: James Zow <v_jweizhao@tencent.com>
Co-authored-by: fuweng11 <76141879+fuweng11@users.noreply.github.com>
Co-authored-by: Charles Zhang <dockerzhang@apache.org>
  • Loading branch information
4 people authored Feb 19, 2025
1 parent b18b511 commit 663a1fe
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -648,9 +648,11 @@ public InlongGroupInfo doDeleteCheck(String groupId, String operator) {
String.format("current group status=%s was not allowed to delete", curState));
}

// If the status not allowed deleting directly, you need to delete the related "inlong_stream" first,
// If the status does not allow deleting directly, and the group mode is STANDARD,
// you need to delete the related "inlong_stream" first.
// otherwise, all associated info will be logically deleted.
if (GroupStatus.deleteStreamFirst(curState)) {
if (GroupStatus.deleteStreamFirst(curState)
&& InlongConstants.STANDARD_MODE.equals(groupInfo.getInlongGroupMode())) {
int count = streamService.selectCountByGroupId(groupId);
if (count >= 1) {
throw new BusinessException(ErrorCodeEnum.GROUP_DELETE_HAS_STREAM,
Expand Down

0 comments on commit 663a1fe

Please sign in to comment.