You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@yunikorn.apache.org by GitBox <gi...@apache.org> on 2020/03/25 20:14:12 UTC

[GitHub] [incubator-yunikorn-core] yangwwei commented on a change in pull request #108: [YUNIKORN-47] Support node update action

yangwwei commented on a change in pull request #108: [YUNIKORN-47] Support node update action
URL: https://github.com/apache/incubator-yunikorn-core/pull/108#discussion_r398139862
 
 

 ##########
 File path: pkg/scheduler/scheduling_partition.go
 ##########
 @@ -308,6 +308,19 @@ func (psc *partitionSchedulingContext) addSchedulingNode(info *cache.NodeInfo) {
 	psc.nodes[info.NodeID] = newSchedulingNode(info)
 }
 
+func (psc *partitionSchedulingContext) updateSchedulingNode(info *cache.NodeInfo) {
+	if info == nil {
+		return
+	}
+
+	psc.Lock()
+	defer psc.Unlock()
+	// check consistency and reset to make sure it is consistent again
+	if schedulingNode, ok := psc.nodes[info.NodeID]; ok {
+		schedulingNode.updateNodeInfo(info)
 
 Review comment:
   The comment was misleading. I have removed it.
   I added a WARN log when the node is not there but we attempt to do an update.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@yunikorn.apache.org
For additional commands, e-mail: dev-help@yunikorn.apache.org