kousei47747 commented on code in PR #1009:
URL: https://github.com/apache/yunikorn-core/pull/1009#discussion_r1928009173
##########
pkg/scheduler/partition.go:
##########
@@ -191,17 +252,27 @@ func (pc *PartitionContext) updatePartitionDetails(conf
configs.PartitionConfig)
return ugm.GetUserManager().UpdateConfig(queueConf, conf.Queues[0].Name)
}
+func (pc *PartitionContext) addQueueForValidation(conf []configs.QueueConfig,
parent *objects.Queue) error {
+ err := pc.addQueueInternal(conf, parent,
objects.NewConfiguredQueueForValidation)
+ return err
+}
+
// Process the config structure and create a queue info tree for this partition
func (pc *PartitionContext) addQueue(conf []configs.QueueConfig, parent
*objects.Queue) error {
+ err := pc.addQueueInternal(conf, parent, objects.NewConfiguredQueue)
+ return err
+}
+
+func (pc *PartitionContext) addQueueInternal(conf []configs.QueueConfig,
parent *objects.Queue, newQueueFn func(configs.QueueConfig, *objects.Queue)
(*objects.Queue, error)) error {
Review Comment:
@pbacsko Thanks for reviewing! I'm not sure about these method duplications
either.
My first thought is like you said that NewConfiguredQueue() has some
callers, adding a flag would require all of them to include an additional
parameter. But after implementing these method duplications, the code feels
redundant, and it turns out that more test cases need to be covered.
I'll try the flag approach. Thanks a lot, my confusion is now cleared!
--
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]