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 2022/05/18 08:07:03 UTC

[GitHub] [dolphinscheduler] lenboo commented on a diff in pull request #10093: [BUG][TaskGroup] Task group does not take effect

lenboo commented on code in PR #10093:
URL: https://github.com/apache/dolphinscheduler/pull/10093#discussion_r875594182


##########
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/queue/TaskPriority.java:
##########
@@ -169,15 +182,20 @@ public int compareTo(TaskPriority other) {
         if (this.getTaskInstancePriority() < other.getTaskInstancePriority()) {
             return -1;
         }
-
+        if(this.getTaskGroupPriority() != other.getTaskGroupPriority()){
+            // larger number, higher priority
+            return Constants.OPPOSITE_VALUE * Integer.compare(this.getTaskGroupPriority(), other.getTaskGroupPriority());
+        }
         if (this.getTaskId() > other.getTaskId()) {
             return 1;
         }
         if (this.getTaskId() < other.getTaskId()) {
             return -1;
         }
-
-        return this.getGroupName().compareTo(other.getGroupName());
+        if(!this.getGroupName().equals(other.getGroupName())){

Review Comment:
   > groupName can be null?
   
   maybe, i will check it.



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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