zhuzhurk commented on a change in pull request #10079: [FLINK-14594] Fix
matching logics of ResourceSpec/ResourceProfile/Resource considering double
values
URL: https://github.com/apache/flink/pull/10079#discussion_r346833416
##########
File path:
flink-core/src/main/java/org/apache/flink/api/common/resources/Resource.java
##########
@@ -116,29 +80,32 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
int result = name.hashCode();
- result = 31 * result + resourceAggregateType.ordinal();
- result = 31 * result + (int) value;
+ result = 31 * result + value.hashCode();
return result;
}
+ @Override
+ public String toString() {
+ return String.format("Resource(%s: %s)", name, value);
+ }
+
public String getName() {
return name;
}
- public ResourceAggregateType getResourceAggregateType() {
- return resourceAggregateType;
+ public BigDecimal getValue() {
+ return value;
}
- public double getValue() {
- return value;
+ public double getDoubleValue() {
Review comment:
It's for testing only. You are right it may cause confusion. I will drop it
and let the tests to get the double value by themselves.
----------------------------------------------------------------
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