chia7712 commented on a change in pull request #318:
URL: 
https://github.com/apache/incubator-yunikorn-core/pull/318#discussion_r699402769



##########
File path: pkg/scheduler/objects/node_collection.go
##########
@@ -211,13 +213,7 @@ func (nc *baseNodeCollection) NodeUpdated(node *Node) {
        nc.Lock()
        defer nc.Unlock()
 
-       nref := nc.nodes[node.NodeID]
-       if nref == nil {
-               return
-       }
-
-       updatedScore := nc.scoreNode(node)
-       if nref.nodeScore != updatedScore {
+       if nref, ok := nc.nodes[node.NodeID]; ok {

Review comment:
       >  It looks like you're unconditionally removing and re-adding the node?
   
   yep. That may be a small performance issue since it removes and re-add the 
node even if the resources are not changed. However, the code of checking the 
changes gets more complicated after the type is changed from `float64` to 
`[]float64`. I prefer to update node unconditionally to keep code simpler. 




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