From ce007813fb069d46a56863340d8d580fecddb007 Mon Sep 17 00:00:00 2001 From: dddyszy <913406953@qq.com> Date: Fri, 19 Feb 2021 18:15:43 +0800 Subject: [PATCH] [Improvement][Api] add @Override on the Override method (#4808) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 施洲轶 --- .../service/impl/AccessTokenServiceImpl.java | 5 ++++ .../service/impl/AlertGroupServiceImpl.java | 6 +++++ .../api/service/impl/BaseServiceImpl.java | 7 ++++++ .../service/impl/DataAnalysisServiceImpl.java | 5 ++++ .../service/impl/DataSourceServiceImpl.java | 12 ++++++++++ .../api/service/impl/ExecutorServiceImpl.java | 4 ++++ .../api/service/impl/LoggerServiceImpl.java | 2 ++ .../api/service/impl/MonitorServiceImpl.java | 5 ++++ .../ProcessDefinitionVersionServiceImpl.java | 4 ++++ .../impl/ProcessInstanceServiceImpl.java | 15 +++++++++++- .../api/service/impl/ProjectServiceImpl.java | 12 ++++++++++ .../api/service/impl/QueueServiceImpl.java | 5 ++++ .../service/impl/ResourcesServiceImpl.java | 20 +++++++++++++++- .../service/impl/SchedulerServiceImpl.java | 8 +++++++ .../api/service/impl/SessionServiceImpl.java | 3 +++ .../service/impl/TaskInstanceServiceImpl.java | 2 ++ .../service/impl/TaskRecordServiceImpl.java | 1 + .../api/service/impl/TenantServiceImpl.java | 6 +++++ .../api/service/impl/UdfFuncServiceImpl.java | 7 ++++++ .../api/service/impl/UsersServiceImpl.java | 24 +++++++++++++++++++ .../impl/WorkFlowLineageServiceImpl.java | 4 +++- .../service/impl/WorkerGroupServiceImpl.java | 2 ++ .../queue/PeerTaskInstancePriorityQueue.java | 2 ++ 23 files changed, 158 insertions(+), 3 deletions(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AccessTokenServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AccessTokenServiceImpl.java index 7739755020..2864e9cda9 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AccessTokenServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AccessTokenServiceImpl.java @@ -60,6 +60,7 @@ public class AccessTokenServiceImpl extends BaseServiceImpl implements AccessTok * @param pageSize page size * @return token list for page number and page size */ + @Override public Map queryAccessTokenList(User loginUser, String searchVal, Integer pageNo, Integer pageSize) { Map result = new HashMap<>(); @@ -86,6 +87,7 @@ public class AccessTokenServiceImpl extends BaseServiceImpl implements AccessTok * @param token token string * @return create result code */ + @Override public Map createToken(User loginUser, int userId, String expireTime, String token) { Map result = new HashMap<>(); @@ -123,6 +125,7 @@ public class AccessTokenServiceImpl extends BaseServiceImpl implements AccessTok * @param expireTime token expire time * @return token string */ + @Override public Map generateToken(User loginUser, int userId, String expireTime) { Map result = new HashMap<>(); if (!hasPerm(loginUser,userId)){ @@ -142,6 +145,7 @@ public class AccessTokenServiceImpl extends BaseServiceImpl implements AccessTok * @param id token id * @return delete result code */ + @Override public Map delAccessTokenById(User loginUser, int id) { Map result = new HashMap<>(); @@ -173,6 +177,7 @@ public class AccessTokenServiceImpl extends BaseServiceImpl implements AccessTok * @param token token string * @return update result code */ + @Override public Map updateToken(User loginUser, int id, int userId, String expireTime, String token) { Map result = new HashMap<>(); if (!hasPerm(loginUser,userId)){ diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertGroupServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertGroupServiceImpl.java index 69db87401c..90df9a09a9 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertGroupServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertGroupServiceImpl.java @@ -53,6 +53,7 @@ public class AlertGroupServiceImpl extends BaseServiceImpl implements AlertGroup * * @return alert group list */ + @Override public Map queryAlertgroup() { HashMap result = new HashMap<>(); @@ -72,6 +73,7 @@ public class AlertGroupServiceImpl extends BaseServiceImpl implements AlertGroup * @param pageSize page size * @return alert group list page */ + @Override public Map listPaging(User loginUser, String searchVal, Integer pageNo, Integer pageSize) { Map result = new HashMap<>(); @@ -100,6 +102,7 @@ public class AlertGroupServiceImpl extends BaseServiceImpl implements AlertGroup * @param alertInstanceIds alertInstanceIds * @return create result code */ + @Override public Map createAlertgroup(User loginUser, String groupName, String desc, String alertInstanceIds) { Map result = new HashMap<>(); //only admin can operate @@ -138,6 +141,7 @@ public class AlertGroupServiceImpl extends BaseServiceImpl implements AlertGroup * @param alertInstanceIds alertInstanceIds * @return update result code */ + @Override public Map updateAlertgroup(User loginUser, int id, String groupName, String desc, String alertInstanceIds) { Map result = new HashMap<>(); @@ -174,6 +178,7 @@ public class AlertGroupServiceImpl extends BaseServiceImpl implements AlertGroup * @param id alert group id * @return delete result code */ + @Override @Transactional(rollbackFor = RuntimeException.class) public Map delAlertgroupById(User loginUser, int id) { Map result = new HashMap<>(); @@ -200,6 +205,7 @@ public class AlertGroupServiceImpl extends BaseServiceImpl implements AlertGroup * @param groupName group name * @return check result code */ + @Override public boolean existGroupName(String groupName) { List alertGroup = alertGroupMapper.queryByGroupName(groupName); return CollectionUtils.isNotEmpty(alertGroup); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/BaseServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/BaseServiceImpl.java index 8e8a5ec6de..6b581dbb51 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/BaseServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/BaseServiceImpl.java @@ -40,6 +40,7 @@ public class BaseServiceImpl implements BaseService { * @param user input user * @return ture if administrator, otherwise return false */ + @Override public boolean isAdmin(User user) { return user.getUserType() == UserType.ADMIN_USER; } @@ -51,6 +52,7 @@ public class BaseServiceImpl implements BaseService { * @param result result code * @return true if not administrator, otherwise false */ + @Override public boolean isNotAdmin(User loginUser, Map result) { //only admin can operate if (!isAdmin(loginUser)) { @@ -67,6 +69,7 @@ public class BaseServiceImpl implements BaseService { * @param status status * @param statusParams status message */ + @Override public void putMsg(Map result, Status status, Object... statusParams) { result.put(Constants.STATUS, status); if (statusParams != null && statusParams.length > 0) { @@ -83,6 +86,7 @@ public class BaseServiceImpl implements BaseService { * @param status status * @param statusParams status message */ + @Override public void putMsg(Result result, Status status, Object... statusParams) { result.setCode(status.getCode()); if (statusParams != null && statusParams.length > 0) { @@ -100,6 +104,7 @@ public class BaseServiceImpl implements BaseService { * @param userNoOperationPerm status * @return check result */ + @Override public boolean check(Map result, boolean bool, Status userNoOperationPerm) { // only admin can operate if (bool) { @@ -116,6 +121,7 @@ public class BaseServiceImpl implements BaseService { * @param tenantCode tenant code * @throws IOException if hdfs operation exception */ + @Override public void createTenantDirIfNotExists(String tenantCode) throws IOException { String resourcePath = HadoopUtils.getHdfsResDir(tenantCode); String udfsPath = HadoopUtils.getHdfsUdfDir(tenantCode); @@ -130,6 +136,7 @@ public class BaseServiceImpl implements BaseService { * @param operateUser operate user * @param createUserId create user id */ + @Override public boolean hasPerm(User operateUser, int createUserId) { return operateUser.getId() == createUserId || isAdmin(operateUser); } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataAnalysisServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataAnalysisServiceImpl.java index e0cbd76f27..aaa4cd31fb 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataAnalysisServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataAnalysisServiceImpl.java @@ -95,6 +95,7 @@ public class DataAnalysisServiceImpl extends BaseServiceImpl implements DataAnal * @param endDate end date * @return task state count data */ + @Override public Map countTaskStateByProject(User loginUser, int projectId, String startDate, String endDate) { return countStateByProject( @@ -114,6 +115,7 @@ public class DataAnalysisServiceImpl extends BaseServiceImpl implements DataAnal * @param endDate end date * @return process instance state count data */ + @Override public Map countProcessInstanceStateByProject(User loginUser, int projectId, String startDate, String endDate) { Map result = this.countStateByProject( loginUser, @@ -167,6 +169,7 @@ public class DataAnalysisServiceImpl extends BaseServiceImpl implements DataAnal * @param projectId project id * @return definition count data */ + @Override public Map countDefinitionByUser(User loginUser, int projectId) { Map result = new HashMap<>(); @@ -191,6 +194,7 @@ public class DataAnalysisServiceImpl extends BaseServiceImpl implements DataAnal * @param endDate end date * @return command state count data */ + @Override public Map countCommandState(User loginUser, int projectId, String startDate, String endDate) { Map result = new HashMap<>(); @@ -263,6 +267,7 @@ public class DataAnalysisServiceImpl extends BaseServiceImpl implements DataAnal * @param projectId project id * @return queue state count data */ + @Override public Map countQueueState(User loginUser, int projectId) { Map result = new HashMap<>(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java index 73edea027a..48e73e22f9 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java @@ -89,6 +89,7 @@ public class DataSourceServiceImpl extends BaseServiceImpl implements DataSource * @param parameter datasource parameters * @return create result code */ + @Override public Result createDataSource(User loginUser, String name, String desc, DbType type, String parameter) { Result result = new Result<>(); @@ -132,6 +133,7 @@ public class DataSourceServiceImpl extends BaseServiceImpl implements DataSource * @param id data source id * @return update result code */ + @Override public Result updateDataSource(int id, User loginUser, String name, String desc, DbType type, String parameter) { Result result = new Result<>(); @@ -192,6 +194,7 @@ public class DataSourceServiceImpl extends BaseServiceImpl implements DataSource * @param id datasource id * @return data source detail */ + @Override public Map queryDataSource(int id) { Map result = new HashMap<>(); @@ -287,6 +290,7 @@ public class DataSourceServiceImpl extends BaseServiceImpl implements DataSource * @param pageSize page size * @return data source list page */ + @Override public Map queryDataSourceListPaging(User loginUser, String searchVal, Integer pageNo, Integer pageSize) { Map result = new HashMap<>(); IPage dataSourceList; @@ -339,6 +343,7 @@ public class DataSourceServiceImpl extends BaseServiceImpl implements DataSource * @param type data source type * @return data source list page */ + @Override public Map queryDataSourceList(User loginUser, Integer type) { Map result = new HashMap<>(); @@ -362,6 +367,7 @@ public class DataSourceServiceImpl extends BaseServiceImpl implements DataSource * @param name datasource name * @return true if data datasource not exists, otherwise return false */ + @Override public Result verifyDataSourceName(String name) { Result result = new Result<>(); List dataSourceList = dataSourceMapper.queryDataSourceByName(name); @@ -381,6 +387,7 @@ public class DataSourceServiceImpl extends BaseServiceImpl implements DataSource * @param parameter data source parameters * @return true if connect successfully, otherwise false */ + @Override public Result checkConnection(DbType type, String parameter) { Result result = new Result<>(); BaseDataSource datasource = DataSourceFactory.getDatasource(type, parameter); @@ -407,6 +414,7 @@ public class DataSourceServiceImpl extends BaseServiceImpl implements DataSource * @param id datasource id * @return connect result code */ + @Override public Result connectionTest(int id) { DataSource dataSource = dataSourceMapper.selectById(id); if (dataSource == null) { @@ -430,6 +438,7 @@ public class DataSourceServiceImpl extends BaseServiceImpl implements DataSource * @param principal principal * @return datasource parameter */ + @Override public String buildParameter(DbType type, String host, String port, String database, String principal, String userName, String password, DbConnectType connectType, String other, @@ -548,6 +557,7 @@ public class DataSourceServiceImpl extends BaseServiceImpl implements DataSource * @param datasourceId data source id * @return delete result code */ + @Override @Transactional(rollbackFor = RuntimeException.class) public Result delete(User loginUser, int datasourceId) { Result result = new Result<>(); @@ -580,6 +590,7 @@ public class DataSourceServiceImpl extends BaseServiceImpl implements DataSource * @param userId user id * @return unauthed data source result code */ + @Override public Map unauthDatasource(User loginUser, Integer userId) { Map result = new HashMap<>(); @@ -620,6 +631,7 @@ public class DataSourceServiceImpl extends BaseServiceImpl implements DataSource * @param userId user id * @return authorized result code */ + @Override public Map authedDatasource(User loginUser, Integer userId) { Map result = new HashMap<>(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java index 25d6c396fd..b3e2b2cd74 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java @@ -116,6 +116,7 @@ public class ExecutorServiceImpl extends BaseServiceImpl implements ExecutorServ * @param startParams the global param values which pass to new process instance * @return execute process instance code */ + @Override public Map execProcessInstance(User loginUser, String projectName, int processDefinitionId, String cronTime, CommandType commandType, FailureStrategy failureStrategy, String startNodeList, @@ -196,6 +197,7 @@ public class ExecutorServiceImpl extends BaseServiceImpl implements ExecutorServ * @param processDefineId process definition id * @return check result code */ + @Override public Map checkProcessDefinitionValid(ProcessDefinition processDefinition, int processDefineId) { Map result = new HashMap<>(); if (processDefinition == null) { @@ -219,6 +221,7 @@ public class ExecutorServiceImpl extends BaseServiceImpl implements ExecutorServ * @param executeType execute type * @return execute result code */ + @Override public Map execute(User loginUser, String projectName, Integer processInstanceId, ExecuteType executeType) { Map result = new HashMap<>(); Project project = projectMapper.queryByName(projectName); @@ -413,6 +416,7 @@ public class ExecutorServiceImpl extends BaseServiceImpl implements ExecutorServ * @param processDefineId process definition id * @return check result code */ + @Override public Map startCheckByProcessDefinedId(int processDefineId) { Map result = new HashMap<>(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/LoggerServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/LoggerServiceImpl.java index 112e27028c..db46c5bdfb 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/LoggerServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/LoggerServiceImpl.java @@ -78,6 +78,7 @@ public class LoggerServiceImpl implements LoggerService { * @param limit limit * @return log string data */ + @Override @SuppressWarnings("unchecked") public Result queryLog(int taskInstId, int skipLineNum, int limit) { @@ -117,6 +118,7 @@ public class LoggerServiceImpl implements LoggerService { * @param taskInstId task instance id * @return log byte array */ + @Override public byte[] getLogBytes(int taskInstId) { TaskInstance taskInstance = processService.findTaskInstanceById(taskInstId); if (taskInstance == null || StringUtils.isBlank(taskInstance.getHost())) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/MonitorServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/MonitorServiceImpl.java index 3b25b180aa..7f54e3ef95 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/MonitorServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/MonitorServiceImpl.java @@ -60,6 +60,7 @@ public class MonitorServiceImpl extends BaseServiceImpl implements MonitorServic * @param loginUser login user * @return data base state */ + @Override public Map queryDatabaseState(User loginUser) { Map result = new HashMap<>(); @@ -78,6 +79,7 @@ public class MonitorServiceImpl extends BaseServiceImpl implements MonitorServic * @param loginUser login user * @return master information list */ + @Override public Map queryMaster(User loginUser) { Map result = new HashMap<>(); @@ -95,6 +97,7 @@ public class MonitorServiceImpl extends BaseServiceImpl implements MonitorServic * @param loginUser login user * @return zookeeper information list */ + @Override public Map queryZookeeperState(User loginUser) { Map result = new HashMap<>(); @@ -113,6 +116,7 @@ public class MonitorServiceImpl extends BaseServiceImpl implements MonitorServic * @param loginUser login user * @return worker information list */ + @Override public Map queryWorker(User loginUser) { Map result = new HashMap<>(); @@ -150,6 +154,7 @@ public class MonitorServiceImpl extends BaseServiceImpl implements MonitorServic return result; } + @Override public List getServerListFromZK(boolean isMaster) { checkNotNull(zookeeperMonitor); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionVersionServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionVersionServiceImpl.java index e105afc5c6..be7a3e93b0 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionVersionServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionVersionServiceImpl.java @@ -62,6 +62,7 @@ public class ProcessDefinitionVersionServiceImpl extends BaseServiceImpl impleme * @param processDefinition the process definition that need to record version * @return the newest version number of this process definition */ + @Override public long addProcessDefinitionVersion(ProcessDefinition processDefinition) { long version = this.queryMaxVersionByProcessDefinitionId(processDefinition.getId()) + 1; @@ -111,6 +112,7 @@ public class ProcessDefinitionVersionServiceImpl extends BaseServiceImpl impleme * @param processDefinitionId process definition id * @return the pagination process definition versions info of the certain process definition */ + @Override public Map queryProcessDefinitionVersions(User loginUser, String projectName, int pageNo, int pageSize, int processDefinitionId) { Map result = new HashMap<>(); @@ -152,6 +154,7 @@ public class ProcessDefinitionVersionServiceImpl extends BaseServiceImpl impleme * @param version version number * @return the process definition version info */ + @Override public ProcessDefinitionVersion queryByProcessDefinitionIdAndVersion(int processDefinitionId, long version) { return processDefinitionVersionMapper.queryByProcessDefinitionIdAndVersion(processDefinitionId, version); } @@ -165,6 +168,7 @@ public class ProcessDefinitionVersionServiceImpl extends BaseServiceImpl impleme * @param version version number * @return delele result code */ + @Override public Map deleteByProcessDefinitionIdAndVersion(User loginUser, String projectName, int processDefinitionId, long version) { Map result = new HashMap<>(); Project project = projectMapper.queryByName(projectName); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java index 41e1eab44d..6659a7bcd6 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java @@ -132,6 +132,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce /** * return top n SUCCESS process instance order by running time which started between startTime and endTime */ + @Override public Map queryTopNLongestRunningProcessInstance(User loginUser, String projectName, int size, String startTime, String endTime) { Map result = new HashMap<>(); @@ -179,6 +180,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce * @param processId process instance id * @return process instance detail */ + @Override public Map queryProcessInstanceById(User loginUser, String projectName, Integer processId) { Map result = new HashMap<>(); Project project = projectMapper.queryByName(projectName); @@ -213,6 +215,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce * @param endDate end time * @return process instance list */ + @Override public Map queryProcessInstanceList(User loginUser, String projectName, Integer processDefineId, String startDate, String endDate, String searchVal, String executorName, ExecutionStatus stateType, String host, @@ -281,6 +284,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce * @return task list for the process instance * @throws IOException io exception */ + @Override public Map queryTaskListByProcessId(User loginUser, String projectName, Integer processId) throws IOException { Map result = new HashMap<>(); Project project = projectMapper.queryByName(projectName); @@ -319,6 +323,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce } } + @Override public Map parseLogForDependentResult(String log) throws IOException { Map resultMap = new HashMap<>(); if (StringUtils.isEmpty(log)) { @@ -355,6 +360,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce * @param taskId task id * @return sub process instance detail */ + @Override public Map querySubProcessInstanceByTaskId(User loginUser, String projectName, Integer taskId) { Map result = new HashMap<>(); Project project = projectMapper.queryByName(projectName); @@ -403,6 +409,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce * @return update result code * @throws ParseException parse exception for json parse */ + @Override public Map updateProcessInstance(User loginUser, String projectName, Integer processInstanceId, String processInstanceJson, String scheduleTime, Boolean syncDefine, Flag flag, String locations, String connects) throws ParseException { @@ -503,6 +510,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce * @param subId sub process id * @return parent instance detail */ + @Override public Map queryParentInstanceBySubId(User loginUser, String projectName, Integer subId) { Map result = new HashMap<>(); Project project = projectMapper.queryByName(projectName); @@ -543,6 +551,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce * @param processInstanceId process instance id * @return delete result code */ + @Override @Transactional(rollbackFor = RuntimeException.class) public Map deleteProcessInstanceById(User loginUser, String projectName, Integer processInstanceId) { @@ -582,6 +591,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce * @param processInstanceId process instance id * @return variables data */ + @Override public Map viewVariables(Integer processInstanceId) { Map result = new HashMap<>(); @@ -655,6 +665,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce * @return gantt tree data * @throws Exception exception when json parse */ + @Override public Map viewGantt(Integer processInstanceId) throws Exception { Map result = new HashMap<>(); @@ -723,6 +734,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce * @param states states array * @return process instance list */ + @Override public List queryByProcessDefineIdAndStatus(int processDefinitionId, int[] states) { return processInstanceMapper.queryByProcessDefineIdAndStatus(processDefinitionId, states); } @@ -733,7 +745,8 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce * @param size size * @return process instance list */ - public List queryByProcessDefineId(int processDefinitionId,int size) { + @Override + public List queryByProcessDefineId(int processDefinitionId, int size) { return processInstanceMapper.queryByProcessDefineId(processDefinitionId, size); } diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java index b226359238..81e0eebe2f 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java @@ -69,6 +69,7 @@ public class ProjectServiceImpl extends BaseServiceImpl implements ProjectServic * @param desc description * @return returns an error if it exists */ + @Override public Map createProject(User loginUser, String name, String desc) { Map result = new HashMap<>(); @@ -111,6 +112,7 @@ public class ProjectServiceImpl extends BaseServiceImpl implements ProjectServic * @param projectId project id * @return project detail information */ + @Override public Map queryById(Integer projectId) { Map result = new HashMap<>(); @@ -133,6 +135,7 @@ public class ProjectServiceImpl extends BaseServiceImpl implements ProjectServic * @param projectName project name * @return true if the login user have permission to see the project */ + @Override public Map checkProjectAndAuth(User loginUser, Project project, String projectName) { Map result = new HashMap<>(); if (project == null) { @@ -146,6 +149,7 @@ public class ProjectServiceImpl extends BaseServiceImpl implements ProjectServic return result; } + @Override public boolean hasProjectAndPerm(User loginUser, Project project, Map result) { boolean checkResult = false; if (project == null) { @@ -167,6 +171,7 @@ public class ProjectServiceImpl extends BaseServiceImpl implements ProjectServic * @param pageNo page number * @return project list which the login user have permission to see */ + @Override public Map queryProjectListPaging(User loginUser, Integer pageSize, Integer pageNo, String searchVal) { Map result = new HashMap<>(); PageInfo pageInfo = new PageInfo<>(pageNo, pageSize); @@ -198,6 +203,7 @@ public class ProjectServiceImpl extends BaseServiceImpl implements ProjectServic * @param projectId project id * @return delete result code */ + @Override public Map deleteProject(User loginUser, Integer projectId) { Map result = new HashMap<>(); Project project = projectMapper.selectById(projectId); @@ -252,6 +258,7 @@ public class ProjectServiceImpl extends BaseServiceImpl implements ProjectServic * @param desc description * @return update result code */ + @Override public Map update(User loginUser, Integer projectId, String projectName, String desc) { Map result = new HashMap<>(); @@ -291,6 +298,7 @@ public class ProjectServiceImpl extends BaseServiceImpl implements ProjectServic * @param userId user id * @return the projects which user have not permission to see */ + @Override public Map queryUnauthorizedProject(User loginUser, Integer userId) { Map result = new HashMap<>(); if (isNotAdmin(loginUser, result)) { @@ -341,6 +349,7 @@ public class ProjectServiceImpl extends BaseServiceImpl implements ProjectServic * @param userId user id * @return projects which the user have permission to see, Except for items created by this user */ + @Override public Map queryAuthorizedProject(User loginUser, Integer userId) { Map result = new HashMap<>(); @@ -361,6 +370,7 @@ public class ProjectServiceImpl extends BaseServiceImpl implements ProjectServic * @param loginUser login user * @return projects which the user have permission to see, Except for items created by this user */ + @Override public Map queryProjectCreatedByUser(User loginUser) { Map result = new HashMap<>(); @@ -381,6 +391,7 @@ public class ProjectServiceImpl extends BaseServiceImpl implements ProjectServic * @param loginUser login user * @return */ + @Override public Map queryProjectCreatedAndAuthorizedByUser(User loginUser) { Map result = new HashMap<>(); @@ -440,6 +451,7 @@ public class ProjectServiceImpl extends BaseServiceImpl implements ProjectServic * * @return project list */ + @Override public Map queryAllProjectList() { Map result = new HashMap<>(); List projects = new ArrayList<>(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/QueueServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/QueueServiceImpl.java index 5ebf7014a9..002794dc56 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/QueueServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/QueueServiceImpl.java @@ -62,6 +62,7 @@ public class QueueServiceImpl extends BaseServiceImpl implements QueueService { * @param loginUser login user * @return queue list */ + @Override public Map queryList(User loginUser) { Map result = new HashMap<>(); if (isNotAdmin(loginUser, result)) { @@ -84,6 +85,7 @@ public class QueueServiceImpl extends BaseServiceImpl implements QueueService { * @param pageSize page size * @return queue list */ + @Override public Map queryList(User loginUser, String searchVal, Integer pageNo, Integer pageSize) { Map result = new HashMap<>(); if (isNotAdmin(loginUser, result)) { @@ -112,6 +114,7 @@ public class QueueServiceImpl extends BaseServiceImpl implements QueueService { * @param queueName queue name * @return create result */ + @Override public Map createQueue(User loginUser, String queue, String queueName) { Map result = new HashMap<>(); if (isNotAdmin(loginUser, result)) { @@ -161,6 +164,7 @@ public class QueueServiceImpl extends BaseServiceImpl implements QueueService { * @param queueName queue name * @return update result code */ + @Override public Map updateQueue(User loginUser, int id, String queue, String queueName) { Map result = new HashMap<>(); if (isNotAdmin(loginUser, result)) { @@ -229,6 +233,7 @@ public class QueueServiceImpl extends BaseServiceImpl implements QueueService { * @param queueName queue name * @return true if the queue name not exists, otherwise return false */ + @Override public Result verifyQueue(String queue, String queueName) { Result result = new Result<>(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java index 08709343b9..f61996223e 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java @@ -118,6 +118,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe * @param currentDir current directory * @return create directory result */ + @Override @Transactional(rollbackFor = Exception.class) public Result createDirectory(User loginUser, String name, @@ -181,6 +182,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe * @param currentDir current directory * @return create result code */ + @Override @Transactional(rollbackFor = Exception.class) public Result createResource(User loginUser, String name, @@ -263,6 +265,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe * @param file resource file * @return update result code */ + @Override @Transactional(rollbackFor = Exception.class) public Result updateResource(User loginUser, int resourceId, @@ -507,6 +510,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe * @param pageSize page size * @return resource list page */ + @Override public Map queryResourceListPaging(User loginUser, int directoryId, ResourceType type, String searchVal, Integer pageNo, Integer pageSize) { HashMap result = new HashMap<>(); @@ -606,6 +610,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe * @param type resource type * @return resource list */ + @Override public Map queryResourceList(User loginUser, ResourceType type) { Map result = new HashMap<>(); @@ -628,6 +633,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe * @param type resource type * @return resource list */ + @Override public Map queryResourceByProgramType(User loginUser, ResourceType type, ProgramType programType) { Map result = new HashMap<>(); String suffix = ".jar"; @@ -663,6 +669,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe * @return delete result code * @throws IOException exception */ + @Override @Transactional(rollbackFor = Exception.class) public Result delete(User loginUser, int resourceId) throws IOException { Result result = checkResourceUploadStartupState(); @@ -740,6 +747,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe * @param type resource type * @return true if the resource name not exists, otherwise return false */ + @Override public Result verifyResourceName(String fullName, ResourceType type, User loginUser) { Result result = new Result<>(); putMsg(result, Status.SUCCESS); @@ -778,7 +786,8 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe * @param type resource type * @return true if the resource full name or pid not exists, otherwise return false */ - public Result queryResource(String fullName,Integer id,ResourceType type) { + @Override + public Result queryResource(String fullName, Integer id, ResourceType type) { Result result = new Result<>(); if (StringUtils.isBlank(fullName) && id == null) { putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR); @@ -817,6 +826,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe * @param limit limit * @return resource content */ + @Override public Result readResource(int resourceId, int skipLineNum, int limit) { Result result = checkResourceUploadStartupState(); if (!result.getCode().equals(Status.SUCCESS.getCode())) { @@ -884,6 +894,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe * @param currentDir current directory * @return create result code */ + @Override @Transactional(rollbackFor = Exception.class) public Result onlineCreateResource(User loginUser, ResourceType type, String fileName, String fileSuffix, String desc, String content,int pid,String currentDir) { Result result = checkResourceUploadStartupState(); @@ -979,6 +990,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe * @param content content * @return update result cod */ + @Override @Transactional(rollbackFor = Exception.class) public Result updateResourceContent(int resourceId, String content) { Result result = checkResourceUploadStartupState(); @@ -1071,6 +1083,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe * @return resource content * @throws IOException exception */ + @Override public org.springframework.core.io.Resource downloadResource(int resourceId) throws IOException { // if resource upload startup if (!PropertyUtils.getResUploadStartupState()) { @@ -1119,6 +1132,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe * @param userId user id * @return unauthorized result code */ + @Override public Map authorizeResourceTree(User loginUser, Integer userId) { Map result = new HashMap<>(); @@ -1146,6 +1160,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe * @param userId user id * @return unauthorized result code */ + @Override public Map unauthorizedFile(User loginUser, Integer userId) { Map result = new HashMap<>(); @@ -1176,6 +1191,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe * @param userId user id * @return unauthorized result code */ + @Override public Map unauthorizedUDFFunction(User loginUser, Integer userId) { Map result = new HashMap<>(); //only admin can operate @@ -1206,6 +1222,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe * @param userId user id * @return authorized result code */ + @Override public Map authorizedUDFFunction(User loginUser, Integer userId) { Map result = new HashMap<>(); if (isNotAdmin(loginUser, result)) { @@ -1224,6 +1241,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe * @param userId user id * @return authorized result */ + @Override public Map authorizedFile(User loginUser, Integer userId) { Map result = new HashMap<>(); if (isNotAdmin(loginUser, result)) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java index 6f0aee56dc..5955a447e9 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java @@ -107,6 +107,7 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe * @param workerGroup worker group * @return create result code */ + @Override @Transactional(rollbackFor = RuntimeException.class) public Map insertSchedule(User loginUser, String projectName, Integer processDefineId, @@ -197,6 +198,7 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe * @param scheduleStatus schedule status * @return update result code */ + @Override @Transactional(rollbackFor = RuntimeException.class) public Map updateSchedule(User loginUser, String projectName, @@ -297,6 +299,7 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe * @param scheduleStatus schedule status * @return publish result code */ + @Override @Transactional(rollbackFor = RuntimeException.class) public Map setScheduleState(User loginUser, String projectName, @@ -409,6 +412,7 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe * @param searchVal search value * @return schedule list page */ + @Override public Map querySchedule(User loginUser, String projectName, Integer processDefineId, String searchVal, Integer pageNo, Integer pageSize) { HashMap result = new HashMap<>(); @@ -447,6 +451,7 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe * @param projectName project name * @return schedule list */ + @Override public Map queryScheduleList(User loginUser, String projectName) { Map result = new HashMap<>(); Project project = projectMapper.queryByName(projectName); @@ -489,6 +494,7 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe * @param scheduleId schedule id * @throws RuntimeException runtime exception */ + @Override public void deleteSchedule(int projectId, int scheduleId) { logger.info("delete schedules of project id:{}, schedule id:{}", projectId, scheduleId); @@ -527,6 +533,7 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe * @param scheduleId scheule id * @return delete result code */ + @Override public Map deleteScheduleById(User loginUser, String projectName, Integer scheduleId) { Map result = new HashMap<>(); @@ -576,6 +583,7 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe * @param schedule schedule expression * @return the next five fire time */ + @Override public Map previewSchedule(User loginUser, String projectName, String schedule) { Map result = new HashMap<>(); CronExpression cronExpression; diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SessionServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SessionServiceImpl.java index 07ff8df679..9dc6a6d10b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SessionServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SessionServiceImpl.java @@ -57,6 +57,7 @@ public class SessionServiceImpl extends BaseServiceImpl implements SessionServic * @param request request * @return session */ + @Override public Session getSession(HttpServletRequest request) { String sessionId = request.getHeader(Constants.SESSION_ID); @@ -85,6 +86,7 @@ public class SessionServiceImpl extends BaseServiceImpl implements SessionServic * @param ip ip * @return session string */ + @Override @Transactional(rollbackFor = RuntimeException.class) public String createSession(User user, String ip) { Session session = null; @@ -142,6 +144,7 @@ public class SessionServiceImpl extends BaseServiceImpl implements SessionServic * @param ip no use * @param loginUser login user */ + @Override public void signOut(String ip, User loginUser) { try { /** diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskInstanceServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskInstanceServiceImpl.java index 611c5d9afe..926ffa0c2c 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskInstanceServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskInstanceServiceImpl.java @@ -89,6 +89,7 @@ public class TaskInstanceServiceImpl extends BaseServiceImpl implements TaskInst * @param pageSize page size * @return task list page */ + @Override public Map queryTaskListPaging(User loginUser, String projectName, Integer processInstanceId, String processInstanceName, String taskName, String executorName, String startDate, String endDate, String searchVal, ExecutionStatus stateType, String host, @@ -157,6 +158,7 @@ public class TaskInstanceServiceImpl extends BaseServiceImpl implements TaskInst * @param taskInstanceId task instance id * @return the result code and msg */ + @Override public Map forceTaskSuccess(User loginUser, String projectName, Integer taskInstanceId) { Map result = new HashMap<>(); Project project = projectMapper.queryByName(projectName); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskRecordServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskRecordServiceImpl.java index 2fff0f84e1..c755da057b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskRecordServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskRecordServiceImpl.java @@ -54,6 +54,7 @@ public class TaskRecordServiceImpl extends BaseServiceImpl implements TaskRecord * @param isHistory is history * @return task record list */ + @Override public Map queryTaskRecordListPaging(boolean isHistory, String taskName, String startDate, String taskDate, String sourceTable, String destTable, String endDate, diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TenantServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TenantServiceImpl.java index 49974dbf22..9deef7d035 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TenantServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TenantServiceImpl.java @@ -76,6 +76,7 @@ public class TenantServiceImpl extends BaseServiceImpl implements TenantService * @return create result code * @throws Exception exception */ + @Override @Transactional(rollbackFor = Exception.class) public Map createTenant(User loginUser, String tenantCode, @@ -133,6 +134,7 @@ public class TenantServiceImpl extends BaseServiceImpl implements TenantService * @param pageSize page size * @return tenant list page */ + @Override public Map queryTenantList(User loginUser, String searchVal, Integer pageNo, Integer pageSize) { Map result = new HashMap<>(); @@ -163,6 +165,7 @@ public class TenantServiceImpl extends BaseServiceImpl implements TenantService * @return update result code * @throws Exception exception */ + @Override public Map updateTenant(User loginUser, int id, String tenantCode, int queueId, String desc) throws Exception { @@ -226,6 +229,7 @@ public class TenantServiceImpl extends BaseServiceImpl implements TenantService * @return delete result code * @throws Exception exception */ + @Override @Transactional(rollbackFor = Exception.class) public Map deleteTenantById(User loginUser, int id) throws Exception { Map result = new HashMap<>(); @@ -304,6 +308,7 @@ public class TenantServiceImpl extends BaseServiceImpl implements TenantService * @param loginUser login user * @return tenant list */ + @Override public Map queryTenantList(User loginUser) { Map result = new HashMap<>(); @@ -321,6 +326,7 @@ public class TenantServiceImpl extends BaseServiceImpl implements TenantService * @param tenantCode tenant code * @return true if tenant code can user, otherwise return false */ + @Override public Result verifyTenantCode(String tenantCode) { Result result = new Result(); if (checkTenantExists(tenantCode)) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UdfFuncServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UdfFuncServiceImpl.java index e1e293f8a3..27a3b60e92 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UdfFuncServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UdfFuncServiceImpl.java @@ -76,6 +76,7 @@ public class UdfFuncServiceImpl extends BaseServiceImpl implements UdfFuncServic * @param className class name * @return create result code */ + @Override public Result createUdfFunction(User loginUser, String funcName, String className, @@ -147,6 +148,7 @@ public class UdfFuncServiceImpl extends BaseServiceImpl implements UdfFuncServic * @param id udf function id * @return udf function detail */ + @Override public Map queryUdfFuncDetail(int id) { Map result = new HashMap<>(); UdfFunc udfFunc = udfFuncMapper.selectById(id); @@ -172,6 +174,7 @@ public class UdfFuncServiceImpl extends BaseServiceImpl implements UdfFuncServic * @param className class name * @return update result code */ + @Override public Map updateUdfFunc(int udfFuncId, String funcName, String className, @@ -242,6 +245,7 @@ public class UdfFuncServiceImpl extends BaseServiceImpl implements UdfFuncServic * @param searchVal search value * @return udf function list page */ + @Override public Map queryUdfFuncListPaging(User loginUser, String searchVal, Integer pageNo, Integer pageSize) { Map result = new HashMap<>(); PageInfo pageInfo = new PageInfo<>(pageNo, pageSize); @@ -278,6 +282,7 @@ public class UdfFuncServiceImpl extends BaseServiceImpl implements UdfFuncServic * @param type udf type * @return udf func list */ + @Override public Map queryUdfFuncList(User loginUser, Integer type) { Map result = new HashMap<>(); int userId = loginUser.getId(); @@ -297,6 +302,7 @@ public class UdfFuncServiceImpl extends BaseServiceImpl implements UdfFuncServic * @param id udf function id * @return delete result code */ + @Override @Transactional(rollbackFor = RuntimeException.class) public Result delete(int id) { Result result = new Result<>(); @@ -312,6 +318,7 @@ public class UdfFuncServiceImpl extends BaseServiceImpl implements UdfFuncServic * @param name name * @return true if the name can user, otherwise return false */ + @Override public Result verifyUdfFuncByName(String name) { Result result = new Result<>(); if (checkUdfFuncNameExists(name)) { diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java index 50ad9e6c30..865f4c329a 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java @@ -122,6 +122,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @return create result code * @throws Exception exception */ + @Override @Transactional(rollbackFor = Exception.class) public Map createUser(User loginUser, String userName, @@ -168,6 +169,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { } + @Override @Transactional(rollbackFor = RuntimeException.class) public User createUser(String userName, String userPassword, @@ -202,6 +204,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { /*** * create User for ldap login */ + @Override @Transactional(rollbackFor = Exception.class) public User createUser(UserType userType, String userId, String email) { User user = new User(); @@ -226,6 +229,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @param userName user name * @return exist user or null */ + @Override public User getUserByUserName(String userName) { return userMapper.queryByUserNameAccurately(userName); } @@ -236,6 +240,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @param id id * @return user info */ + @Override public User queryUser(int id) { return userMapper.selectById(id); } @@ -246,6 +251,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @param name name * @return user info */ + @Override public User queryUser(String name) { return userMapper.queryByUserNameAccurately(name); } @@ -257,6 +263,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @param password password * @return user info */ + @Override public User queryUser(String name, String password) { String md5 = EncryptionUtils.getMd5(password); return userMapper.queryUserByNamePassword(name, md5); @@ -268,6 +275,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @param name user name * @return if name empty 0, user not exists -1, user exist user id */ + @Override public int getUserIdByName(String name) { //executor name query int executorId = 0; @@ -292,6 +300,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @param pageSize page size * @return user list page */ + @Override public Map queryUserList(User loginUser, String searchVal, Integer pageNo, Integer pageSize) { Map result = new HashMap<>(); @@ -327,6 +336,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @return update result code * @throws Exception exception */ + @Override public Map updateUser(User loginUser, int userId, String userName, String userPassword, @@ -458,6 +468,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @return delete result code * @throws Exception exception when operate hdfs */ + @Override public Map deleteUserById(User loginUser, int id) throws IOException { Map result = new HashMap<>(); //only admin can operate @@ -497,6 +508,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @param projectIds project id array * @return grant result code */ + @Override @Transactional(rollbackFor = RuntimeException.class) public Map grantProject(User loginUser, int userId, String projectIds) { Map result = new HashMap<>(); @@ -546,6 +558,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @param resourceIds resource id array * @return grant result code */ + @Override @Transactional(rollbackFor = RuntimeException.class) public Map grantResources(User loginUser, int userId, String resourceIds) { Map result = new HashMap<>(); @@ -641,6 +654,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @param udfIds udf id array * @return grant result code */ + @Override @Transactional(rollbackFor = RuntimeException.class) public Map grantUDFFunction(User loginUser, int userId, String udfIds) { Map result = new HashMap<>(); @@ -687,6 +701,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @param datasourceIds data source id array * @return grant result code */ + @Override @Transactional(rollbackFor = RuntimeException.class) public Map grantDataSource(User loginUser, int userId, String datasourceIds) { Map result = new HashMap<>(); @@ -733,6 +748,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @param loginUser login user * @return user info */ + @Override public Map getUserInfo(User loginUser) { Map result = new HashMap<>(); @@ -768,6 +784,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @param loginUser login user * @return user list */ + @Override public Map queryAllGeneralUsers(User loginUser) { Map result = new HashMap<>(); //only admin can operate @@ -788,6 +805,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @param loginUser login user * @return user list */ + @Override public Map queryUserList(User loginUser) { Map result = new HashMap<>(); //only admin can operate @@ -808,6 +826,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @param userName user name * @return true if user name not exists, otherwise return false */ + @Override public Result verifyUserName(String userName) { Result result = new Result<>(); @@ -828,6 +847,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @param alertgroupId alert group id * @return unauthorize result code */ + @Override public Map unauthorizedUser(User loginUser, Integer alertgroupId) { Map result = new HashMap<>(); @@ -864,6 +884,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @param alertgroupId alert group id * @return authorized result code */ + @Override public Map authorizedUser(User loginUser, Integer alertgroupId) { Map result = new HashMap<>(); //only admin can operate @@ -955,6 +976,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @return register result code * @throws Exception exception */ + @Override @Transactional(rollbackFor = RuntimeException.class) public Map registerUser(String userName, String userPassword, String repeatPassword, String email) { Map result = new HashMap<>(); @@ -984,6 +1006,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @param userName user name * @return create result code */ + @Override public Map activateUser(User loginUser, String userName) { Map result = new HashMap<>(); result.put(Constants.STATUS, false); @@ -1027,6 +1050,7 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService { * @param userNames user name * @return create result code */ + @Override public Map batchActivateUser(User loginUser, List userNames) { Map result = new HashMap<>(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkFlowLineageServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkFlowLineageServiceImpl.java index 1a56ebb51c..22c7622ab8 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkFlowLineageServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkFlowLineageServiceImpl.java @@ -43,6 +43,7 @@ public class WorkFlowLineageServiceImpl extends BaseServiceImpl implements WorkF @Autowired private WorkFlowLineageMapper workFlowLineageMapper; + @Override public Map queryWorkFlowLineageByName(String workFlowName, int projectId) { Map result = new HashMap<>(); List workFlowLineageList = workFlowLineageMapper.queryByName(workFlowName, projectId); @@ -68,7 +69,8 @@ public class WorkFlowLineageServiceImpl extends BaseServiceImpl implements WorkF } } - public Map queryWorkFlowLineageByIds(Set ids,int projectId) { + @Override + public Map queryWorkFlowLineageByIds(Set ids, int projectId) { Map result = new HashMap<>(); List workFlowLineageList = workFlowLineageMapper.queryByIds(ids, projectId); Map workFlowLists = new HashMap<>(); diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java index abd8c794c3..81d923e9a0 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java @@ -65,6 +65,7 @@ public class WorkerGroupServiceImpl extends BaseServiceImpl implements WorkerGro * @param pageSize page size * @return worker group list page */ + @Override public Map queryAllGroupPaging(User loginUser, Integer pageNo, Integer pageSize, String searchVal) { // list from index int fromIndex = (pageNo - 1) * pageSize; @@ -113,6 +114,7 @@ public class WorkerGroupServiceImpl extends BaseServiceImpl implements WorkerGro * * @return all worker group list */ + @Override public Map queryAllGroup() { Map result = new HashMap<>(); diff --git a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/PeerTaskInstancePriorityQueue.java b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/PeerTaskInstancePriorityQueue.java index d7a902550f..5ce42242ee 100644 --- a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/PeerTaskInstancePriorityQueue.java +++ b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/PeerTaskInstancePriorityQueue.java @@ -45,6 +45,7 @@ public class PeerTaskInstancePriorityQueue implements TaskPriorityQueue