Github user govind-menon commented on a diff in the pull request:
https://github.com/apache/storm/pull/2881#discussion_r229853904
--- Diff:
storm-server/src/main/java/org/apache/storm/scheduler/resource/normalization/NormalizedResourceOffer.java
---
@@ -81,6 +81,20 @@ public void add(NormalizedResourcesWithMemory other) {
totalMemoryMb += other.getTotalMemoryMb();
}
+ /**
+ * Remove the resources in other from this.
+ * @param other the resources to be removed.
+ * @return true if one or more resources in other were larger than
available resources in this, else false.
+ */
+ public boolean remove(NormalizedResourcesWithMemory other) {
--- End diff --
I considered that - but my approach seems cleaner so that in the place
where it's called you don't have to wonder about the null.
---