kipshi commented on code in PR #4800:
URL: https://github.com/apache/inlong/pull/4800#discussion_r909251327
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterServiceImpl.java:
##########
@@ -83,19 +88,111 @@ public class InlongClusterServiceImpl implements
InlongClusterService {
@Autowired
private InlongClusterOperatorFactory clusterOperatorFactory;
@Autowired
+ private InlongClusterTagEntityMapper clusterTagMapper;
+ @Autowired
private InlongClusterEntityMapper clusterMapper;
@Autowired
private InlongClusterNodeEntityMapper clusterNodeMapper;
@Autowired
private DataProxyConfigRepository proxyRepository;
+ @Override
+ public Integer saveTag(ClusterTagRequest request, String operator) {
+ LOGGER.debug("begin to save cluster tag {}", request);
+ Preconditions.checkNotNull(request, "cluster tag cannot be empty");
+
+ // check if the cluster tag already exist
+ String clusterTag = request.getClusterTag();
+ InlongClusterTagEntity exist =
clusterTagMapper.selectByTag(clusterTag);
+ if (exist != null) {
+ String errMsg = String.format("inlong cluster tag already exist
for cluster tag=%s", clusterTag);
+ LOGGER.error(errMsg);
+ throw new BusinessException(errMsg);
+ }
+
+ InlongClusterTagEntity entity =
CommonBeanUtils.copyProperties(request, InlongClusterTagEntity::new);
+ clusterTagMapper.insert(entity);
+ LOGGER.info("success to save cluster tag={} by user={}", request,
operator);
Review Comment:
some use Logger.debug , other use Logger.info, should be unity
--
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]