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



##########
File path: pkg/scheduler/objects/queue.go
##########
@@ -182,36 +195,86 @@ func (sq *Queue) mergeProperties(parent, config 
map[string]string) {
        }
 }
 
-// Set the properties that the dynamic child queue inherits from the parent
-// The properties list for the parent must be retrieved using getProperties()
-// This currently only sets the sort policy as it is set on the parent
-// Further implementation is part of YUNIKORN-193
-// lock free call
-func (sq *Queue) setTemplateProperties(parent map[string]string) {
-       if len(parent) == 0 {
-               return
+// try to find a template from closet parent
+func lookupTemplate(sq *Queue) *template.Template {
+       if sq == nil {
+               return nil
        }
-       // for a leaf queue pull out all values from the template and set each 
of them
-       // See YUNIKORN-193: for now just copy one attr from parent
-       if sq.isLeaf {
-               if parent[configs.ApplicationSortPolicy] != "" {
-                       sq.properties[configs.ApplicationSortPolicy] = 
parent[configs.ApplicationSortPolicy]
-               }
+       if current := sq.template; current != nil {
+               return current
        }
-       // for a parent queue we just copy the template from its parent (no 
need to be recursive)
-       // this stops at the first managed queue
-       // See YUNIKORN-193
+       return lookupTemplate(sq.parent)
 }
 
-func (sq *Queue) SetQueueConfig(conf configs.QueueConfig) error {
+func (sq *Queue) ApplyConf(conf configs.QueueConfig) error {
        sq.Lock()
        defer sq.Unlock()
-       return sq.setQueueConfig(conf)
+       return sq.applyConf(conf)
+}

Review comment:
       will copy that!




-- 
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-unsubscr...@yunikorn.apache.org

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


Reply via email to