flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] zentol commented on a change in pull request #10079: [FLINK-14594] Fix matching logics of ResourceSpec/ResourceProfile/Resource considering double values
Date Fri, 15 Nov 2019 12:17:48 GMT
zentol 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_r346796784
 
 

 ##########
 File path: flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/ResourceProfile.java
 ##########
 @@ -367,13 +348,22 @@ public int hashCode() {
 		return result;
 	}
 
+	/**
+	 * Note: Avoid to use this method to do resource checking,
+	 * unless a strict comparison is desired regarding the double values.
+	 * Use {@link #isMatching(ResourceProfile)} or {@link #hasSameResources(ResourceProfile)}
+	 * instead to compare resources ignoring smaller deltas of double values.
 
 Review comment:
   this seems inaccurate; we aren't ignoring deltas; the different between equals and isMatching
boils down to specifics of BigDecimal comparisons, which are unrelated to deltas and more
about value vs representation.
   
   What's our use-case for making this distinction? Seems like we actually always want to
use `hasSameResources`. This seems like we're leaking implementation details to the API.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message