Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Fix em sort error #4915

Merged
merged 2 commits into from Sep 25, 2023
Merged

[BUG] Fix em sort error #4915

merged 2 commits into from Sep 25, 2023

Conversation

sjgllgh
Copy link
Contributor

@sjgllgh sjgllgh commented Sep 25, 2023

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

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

Checklist

  • I have read the Contributing Guidelines on pull requests.
  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the Linkis mailing list first)
  • If this is a code change: I have written unit tests to fully verify the new behavior.

Copy link
Contributor

@peacewong peacewong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@peacewong peacewong merged commit c0cebe4 into apache:master Sep 25, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants