zhuqi-lucas commented on code in PR #950:
URL: https://github.com/apache/yunikorn-core/pull/950#discussion_r1721489038


##########
pkg/scheduler/objects/node.go:
##########
@@ -377,6 +382,8 @@ func (sn *Node) ReplaceAllocation(allocationKey string, 
replace *Allocation, del
        // The allocatedResource and availableResource should be updated in the 
same way
        sn.allocatedResource.AddTo(delta)
        sn.availableResource.SubFrom(delta)
+       sn.allocatedResource.Prune()
+       sn.availableResource.Prune()

Review Comment:
   Addressed in latest PR, thanks!



##########
pkg/scheduler/objects/node.go:
##########
@@ -353,6 +356,8 @@ func (sn *Node) addAllocationInternal(alloc *Allocation, 
force bool) bool {
                sn.allocations[alloc.GetAllocationKey()] = alloc
                sn.allocatedResource.AddTo(res)
                sn.availableResource.SubFrom(res)
+               sn.allocatedResource.Prune()
+               sn.availableResource.Prune()

Review Comment:
   Addressed in latest PR, thanks!



##########
pkg/scheduler/objects/node.go:
##########
@@ -312,6 +313,8 @@ func (sn *Node) RemoveAllocation(allocationKey string) 
*Allocation {
                delete(sn.allocations, allocationKey)
                sn.allocatedResource.SubFrom(alloc.GetAllocatedResource())
                sn.availableResource.AddTo(alloc.GetAllocatedResource())
+               sn.allocatedResource.Prune()
+               sn.availableResource.Prune()

Review Comment:
   Addressed in latest PR, thanks!



##########
pkg/scheduler/objects/application.go:
##########
@@ -1686,6 +1692,8 @@ func (sa *Application) addAllocationInternal(allocType 
AllocationResultType, all
                sa.incUserResourceUsage(alloc.GetAllocatedResource())
                sa.allocatedResource = resources.Add(sa.allocatedResource, 
alloc.GetAllocatedResource())
                sa.maxAllocatedResource = 
resources.ComponentWiseMax(sa.allocatedResource, sa.maxAllocatedResource)
+               sa.allocatedResource.Prune()
+               sa.maxAllocatedResource.Prune()

Review Comment:
   Addressed in latest PR, thanks!



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

Reply via email to