You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2020/10/26 13:25:04 UTC

[GitHub] [incubator-dolphinscheduler] dailidong commented on a change in pull request #3605: [Test][API] full cover DataAnalysisServiceImpl

dailidong commented on a change in pull request #3605:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/3605#discussion_r511955777



##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataAnalysisServiceImpl.java
##########
@@ -311,59 +265,9 @@
             return result;
         }
 
-        // TODO tasksQueueList and tasksKillList is never updated.
-        List<String> tasksQueueList = new ArrayList<>();
-        List<String> tasksKillList = new ArrayList<>();
-
         Map<String, Integer> dataMap = new HashMap<>();
-        if (loginUser.getUserType() == UserType.ADMIN_USER) {
-            dataMap.put("taskQueue", tasksQueueList.size());
-            dataMap.put("taskKill", tasksKillList.size());
-
-            result.put(Constants.DATA_LIST, dataMap);
-            putMsg(result, Status.SUCCESS);
-            return result;
-        }
-
-        int[] tasksQueueIds = new int[tasksQueueList.size()];
-        int[] tasksKillIds = new int[tasksKillList.size()];
-
-        int i = 0;
-        for (String taskQueueStr : tasksQueueList) {
-            if (StringUtils.isNotEmpty(taskQueueStr)) {
-                String[] splits = taskQueueStr.split("_");
-                if (splits.length >= 4) {
-                    tasksQueueIds[i++] = Integer.parseInt(splits[3]);
-                }
-            }
-        }
-
-        i = 0;
-        for (String taskKillStr : tasksKillList) {
-            if (StringUtils.isNotEmpty(taskKillStr)) {
-                String[] splits = taskKillStr.split("-");
-                if (splits.length == 2) {
-                    tasksKillIds[i++] = Integer.parseInt(splits[1]);
-                }
-            }
-        }
-        Integer taskQueueCount = 0;
-        Integer taskKillCount = 0;
-
-        Integer[] projectIds = getProjectIdsArrays(loginUser, projectId);
-        if (tasksQueueIds.length != 0) {
-            taskQueueCount = taskInstanceMapper.countTask(
-                    projectIds,
-                    tasksQueueIds);
-        }
-
-        if (tasksKillIds.length != 0) {
-            taskKillCount = taskInstanceMapper.countTask(projectIds, tasksKillIds);
-        }
-
-        dataMap.put("taskQueue", taskQueueCount);
-        dataMap.put("taskKill", taskKillCount);

Review comment:
       yes, it need to add detail data info , TODO 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org