SbloodyS commented on code in PR #17614:
URL: 
https://github.com/apache/dolphinscheduler/pull/17614#discussion_r2480032322


##########
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/Repository.java:
##########
@@ -87,4 +92,19 @@ public List<TaskInstance> queryAllTaskInstance() {
         return taskInstanceDao.queryAll();
     }
 
+    /**
+     * Return the list of {@link TaskGroupQueue} records for a given workflow 
definition
+     * in descending order of their IDs.
+     *
+     * @param workflowDefinition the workflow definition
+     * @return the list of {@link TaskGroupQueue} records ordered by priority 
descending
+     */
+    public List<TaskGroupQueue> queryTaskGroupQueue(WorkflowDefinition 
workflowDefinition) {
+        return queryWorkflowInstance(workflowDefinition)
+                .stream()
+                .flatMap(workflowInstance -> 
taskGroupQueueDao.queryByWorkflowInstanceId(workflowInstance.getId())
+                        .stream())
+                .sorted(Comparator.comparingInt(TaskGroupQueue::getId))
+                .collect(Collectors.toList());

Review Comment:
   I'm not sure if we should add this code for a test. cc @ruanwenjun 



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

Reply via email to