xintongsong commented on a change in pull request #9910: [FLINK-14405][runtime]
Align ResourceProfile/ResourceSpec fields with the new TaskExecutor memory
setups.
URL: https://github.com/apache/flink/pull/9910#discussion_r343464343
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/ResourceProfile.java
##########
@@ -292,7 +349,15 @@ public boolean isMatching(ResourceProfile required) {
@Override
public int compareTo(@Nonnull ResourceProfile other) {
- int cmp = Integer.compare(this.getMemoryInMB(),
other.getMemoryInMB());
+ if (this == other) {
+ return 0;
+ } else if (this == UNKNOWN) {
Review comment:
It's possible. E.g., we may need to sort slot requests according to their
resources, of which some might be unknown and others might be specified.
I think `ResourceProfile#compareTo` should not assume whether an unknown
profile will be compared or not. It should be able to handle call possible
values as a `Comparable`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services