calvinjiang commented on code in PR #14893:
URL:
https://github.com/apache/dolphinscheduler/pull/14893#discussion_r1323809918
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java:
##########
@@ -177,6 +195,52 @@ private boolean checkWorkerGroupNameExists(WorkerGroup
workerGroup) {
return false;
}
+ /**
+ * check if the worker group has any dependent tasks,schedulers or
environments.
+ *
+ * @param workerGroup worker group
+ * @return boolean
+ */
+ private boolean checkWorkerGroupDependencies(WorkerGroup workerGroup,
Map<String, Object> result) {
+ // check if the worker group has any dependent tasks
+ List<TaskDefinition> taskDefinitions = taskDefinitionMapper.selectList(
+ new
QueryWrapper<TaskDefinition>().lambda().eq(TaskDefinition::getWorkerGroup,
workerGroup.getName()));
+
+ if (CollectionUtils.isNotEmpty(taskDefinitions)) {
+ List<String> taskNames =
taskDefinitions.stream().limit(3).map(taskDefinition ->
taskDefinition.getName())
Review Comment:
Here are just a part of examples to help users understand why they can not
remove or rename the work group. If there are a lot of tasks, timings or
environments that are dependent on the work group, it's not so good for the tip
to display all of those.
--
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]