You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2021/09/01 09:07:53 UTC

[GitHub] [incubator-yunikorn-core] chia7712 commented on a change in pull request #318: [YUNIKORN-831] node sorting should check other resources of nodes ins…

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: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org