xintongsong commented on a change in pull request #8841: 
[FLINK-12765][coordinator] Bookkeeping of available resources of allocated 
slots in SlotPool
URL: https://github.com/apache/flink/pull/8841#discussion_r297465087
 
 

 ##########
 File path: 
flink-core/src/main/java/org/apache/flink/api/common/resources/Resource.java
 ##########
 @@ -73,12 +73,35 @@ public Resource merge(Resource other) {
 
                        case AGGREGATE_TYPE_SUM:
                        default:
-                               aggregatedValue = this.value + other.value;
+                               aggregatedValue = value + other.value;
                }
 
                return create(aggregatedValue, resourceAggregateType);
        }
 
+       public Resource subtract(Resource other) {
+               Preconditions.checkArgument(getClass() == other.getClass(), 
"Subtract with different resource resourceAggregateType");
 
 Review comment:
   Confusing error message. Maybe "different resource resourceAggregateType" -> 
"different resource class"

----------------------------------------------------------------
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

Reply via email to