From 8bf83ba9ad927d2a4ffdf0296f8059145cabda6b Mon Sep 17 00:00:00 2001 From: Tboy Date: Thu, 24 Oct 2019 14:53:19 +0800 Subject: [PATCH] update AlertGroupService, extends from BaseService, remove duplicate methods (#1091) * move updateTaskState into try/catch block in case of exception * fix NPE * using conf.getInt instead of getString * for AbstractZKClient, remove the log, for it will print the same log message in createZNodePath. for AlertDao, correct the spelling. * duplicate * refactor getTaskWorkerGroupId * add friendly log * update hearbeat thread num = 1 * fix the bug when worker execute task using queue. and remove checking Tenant user anymore in TaskScheduleThread * 1. move verifyTaskInstanceIsNull after taskInstance 2. keep verifyTenantIsNull/verifyTaskInstanceIsNull clean and readable * fix the message * delete before check to avoid KeeperException$NoNodeException * fix the message * check processInstance state before delete tenant * check processInstance state before delete worker group * refactor * merge api constants into common constatns * update the resource perm * update the dataSource perm * fix CheckUtils.checkUserParams method * update AlertGroupService, extends from BaseService, remove duplicate methods --- .../api/service/AlertGroupService.java | 27 +------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AlertGroupService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AlertGroupService.java index 8c0aabd43a..d74c63eea0 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AlertGroupService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/AlertGroupService.java @@ -44,7 +44,7 @@ import java.util.Map; * alert group service */ @Service -public class AlertGroupService { +public class AlertGroupService extends BaseService{ private static final Logger logger = LoggerFactory.getLogger(AlertGroupService.class); @@ -269,29 +269,4 @@ public class AlertGroupService { return result; } - - /** - * is admin? - * @param loginUser - * @param result - * @return - */ - private boolean checkAdmin(User loginUser, Map result) { - if (!isAdmin(loginUser)) { - putMsg(result, Status.USER_NO_OPERATION_PERM); - return true; - } - return false; - } - - /** - * put message - * - * @param result - * @param status - */ - private void putMsg(Map result, Status status) { - result.put(Constants.STATUS, status); - result.put(Constants.MSG, status.getMsg()); - } }