flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] azagrebin commented on a change in pull request #9910: [FLINK-14405][runtime] Align ResourceProfile/ResourceSpec fields with the new TaskExecutor memory setups.
Date Wed, 16 Oct 2019 15:36:36 GMT
azagrebin 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_r335501569
 
 

 ##########
 File path: flink-core/src/main/java/org/apache/flink/api/common/operators/ResourceSpec.java
 ##########
 @@ -229,15 +246,14 @@ public boolean isValid() {
 	 */
 	public boolean lessThanOrEqual(@Nonnull ResourceSpec other) {
 		if (this == UNKNOWN || other == UNKNOWN) {
-			throw new IllegalArgumentException("UNKNOWN ResourceSpec cannot be numerically compared.");
+			throw new IllegalArgumentException("UNKNOWN ResourceSpecs cannot be numerically compared.");
 		}
 		int cmp1 = Double.compare(this.cpuCores, other.cpuCores);
-		int cmp2 = Integer.compare(this.heapMemoryInMB, other.heapMemoryInMB);
-		int cmp3 = Integer.compare(this.directMemoryInMB, other.directMemoryInMB);
-		int cmp4 = Integer.compare(this.nativeMemoryInMB, other.nativeMemoryInMB);
-		int cmp5 = Integer.compare(this.stateSizeInMB, other.stateSizeInMB);
-		int cmp6 = Integer.compare(this.managedMemoryInMB, other.managedMemoryInMB);
-		if (cmp1 <= 0 && cmp2 <= 0 && cmp3 <= 0 && cmp4 <=
0 && cmp5 <= 0 && cmp6 <= 0) {
+		int cmp2 = Long.compare(this.taskHeapMemory.getBytes(), other.taskHeapMemory.getBytes());
 
 Review comment:
   one more hotfix with making `MemorySize` `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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message