kingamarton commented on a change in pull request #303:
URL:
https://github.com/apache/incubator-yunikorn-k8shim/pull/303#discussion_r710909399
##########
File path: pkg/cache/external/scheduler_cache.go
##########
@@ -65,6 +65,16 @@ func (cache *SchedulerCache) GetNodesInfoMap()
map[string]*schedulernode.NodeInf
return cache.nodesMap
}
+func (cache *SchedulerCache) GetNodesInfoMapCopy()
map[string]*schedulernode.NodeInfo {
+ cache.lock.RLock()
+ defer cache.lock.RUnlock()
+ copyOfMap := make(map[string]*schedulernode.NodeInfo,
len(cache.nodesMap))
+ for k, v := range cache.nodesMap {
+ copyOfMap[k] = v.Clone()
Review comment:
Do we need to clone the NodeInfo here? I think it is enough to just pass
it: copyOfMap[k] = v
--
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]