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_r335794879
 
 

 ##########
 File path: 
flink-core/src/main/java/org/apache/flink/api/common/operators/ResourceSpec.java
 ##########
 @@ -257,12 +273,11 @@ public boolean equals(Object obj) {
                } else if (obj != null && obj.getClass() == ResourceSpec.class) 
{
                        ResourceSpec that = (ResourceSpec) obj;
                        return this.cpuCores == that.cpuCores &&
-                                       this.heapMemoryInMB == 
that.heapMemoryInMB &&
-                                       this.directMemoryInMB == 
that.directMemoryInMB &&
-                                       this.nativeMemoryInMB == 
that.nativeMemoryInMB &&
-                                       this.stateSizeInMB == 
that.stateSizeInMB &&
-                                       this.managedMemoryInMB == 
that.managedMemoryInMB &&
-                                       Objects.equals(this.extendedResources, 
that.extendedResources);
+                               (this.taskHeapMemory == null ? 
that.taskHeapMemory == null : this.taskHeapMemory.equals(that.taskHeapMemory)) 
&&
 
 Review comment:
   If we guarantee the fields cannot be null unless the `ResourceProfile` is 
`UNKNOWN`, we do not need to handle the null cases for individual fields.

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


With regards,
Apache Git Services

Reply via email to