craigcondit commented on code in PR #933:
URL: https://github.com/apache/yunikorn-core/pull/933#discussion_r1707754384
##########
pkg/common/resources/resources.go:
##########
@@ -364,6 +364,21 @@ func (r *Resource) SubOnlyExisting(delta *Resource) {
}
}
+// AddOnlyExisting adds delta to defined resource.
+// Ignore any type not defined in the base resource (ie receiver).
+func (r *Resource) AddOnlyExisting(delta *Resource) *Resource {
Review Comment:
I actually like the existing SubOnlyExisting() semantics -- it lets the
caller determine whether or not the resource is immuatable (if we're accessing
under lock, it's safe to mutate, and saves an expensive Clone()). For values
not under lock, Clone() and then modify makes sense.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]