Apache Linkis builds a computation middleware layer to facilitate connection, governance and orchestration between the upper applications and the underlying data engines.
Fix the bug that the sortByResource method in ResourceNodeSelectRule violates the general contract of comparators.
Related issues/PRs
Related issues: #4911
Brief change log
Added and implemented a compare method for the Resource abstract class and its subclasses.;
Modified the Java class ResourceNodeSelectRule to ensure that sortByResource uses the correct sorting method.
Note
For LoadInstanceResource, memory is compared first. If the memory is the same, the number of CPU cores is compared. When the number of CPU cores is the same, the number of instances that have been launched will be compared. Other subcategories also adopted similar comparison rules.
What is the purpose of the change
Fix the bug that the sortByResource method in ResourceNodeSelectRule violates the general contract of comparators.
Related issues/PRs
Related issues: #4911
Brief change log
Note
Checklist