private void deleteSources(List<String> inlongGroupIds) {
        List<StreamSourceEntity> sourceList = sourceMapper.selectByGroupIds(inlongGroupIds);
        if (CollectionUtils.isEmpty(sourceList)) {
            return;
        }

        List<Integer> idList = new ArrayList<>();
        for (StreamSourceEntity source : sourceList) {
            if (SourceStatus.SOURCE_NORMAL.getCode().equals(source.getStatus())
                    && StringUtils.isNotBlank(source.getInlongClusterNodeGroup())) {
                idList.add(source.getId());
            }
        }

        if (CollectionUtils.isNotEmpty(idList)) {
            sourceMapper.logicalDeleteByIds(idList, SourceStatus.TO_BE_ISSUED_DELETE.getCode());
            log.info("success to delete stream source with id in {}", idList);
        }
    }
Delete all stream source which is running but its inlong group was deleted.
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/task/DeleteStreamSourceTask.java