Radeity commented on code in PR #16069:
URL:
https://github.com/apache/dolphinscheduler/pull/16069#discussion_r1614537271
##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/BaseTaskExecuteRunnable.java:
##########
@@ -52,4 +52,30 @@ public TaskExecutionContext getTaskExecutionContext() {
return taskExecutionContext;
}
+ @Override
+ public int compareTo(TaskExecuteRunnable other) {
+ if (other == null) {
+ return 1;
+ }
+ int workflowInstancePriorityCompareResult =
workflowInstance.getProcessInstancePriority().getCode() -
+
other.getWorkflowInstance().getProcessInstancePriority().getCode();
+ if (workflowInstancePriorityCompareResult != 0) {
+ return workflowInstancePriorityCompareResult;
+ }
+
+ int taskInstancePriorityCompareResult =
taskInstance.getTaskInstancePriority().getCode()
+ - other.getTaskInstance().getTaskInstancePriority().getCode();
+ if (taskInstancePriorityCompareResult != 0) {
+ return taskInstancePriorityCompareResult;
+ }
+ // larger number, higher priority
+ int taskGroupPriorityCompareResult =
+ taskInstance.getTaskGroupPriority() -
other.getTaskInstance().getTaskGroupPriority();
+ if (taskGroupPriorityCompareResult != 0) {
+ return -taskGroupPriorityCompareResult;
Review Comment:
I see, but according to UT and code logic, task instance of `Priority.HIGH`
has higher priority than `Priority.LOW`
--
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]