pbacsko commented on code in PR #563:
URL: https://github.com/apache/yunikorn-core/pull/563#discussion_r1228222851
##########
pkg/scheduler/ugm/queue_tracker.go:
##########
@@ -115,6 +132,74 @@ func (qt *QueueTracker) decreaseTrackedResource(queuePath
string, applicationID
return removeQT, nil
}
+func (qt *QueueTracker) setMaxApplications(count uint64, queuePath string)
error {
+ log.Logger().Debug("Setting max applications",
+ zap.String("queue path", queuePath),
+ zap.Uint64("max applications", count))
+ var childQueuePath, immediateChildQueueName string
+ childQueuePath, immediateChildQueueName = getChildQueuePath(queuePath)
+ childQueueTracker := qt
+ if childQueuePath != "" {
+ for childQueuePath != "" {
+ if childQueueTracker != nil {
+ if len(childQueueTracker.childQueueTrackers) ==
0 || childQueueTracker.childQueueTrackers[immediateChildQueueName] == nil {
+ newChildQt :=
newQueueTracker(immediateChildQueueName)
+
childQueueTracker.childQueueTrackers[immediateChildQueueName] = newChildQt
+ childQueueTracker = newChildQt
+ } else {
+ childQueueTracker =
childQueueTracker.childQueueTrackers[immediateChildQueueName]
+ }
+ }
+ childQueuePath, immediateChildQueueName =
getChildQueuePath(childQueuePath)
+ }
+ }
+
+ if int(childQueueTracker.maxRunningApps) != 0 &&
len(childQueueTracker.runningApplications) > int(count) {
+ log.Logger().Warn("Current running applications is greater than
config max applications",
+ zap.String("queue path", queuePath),
+ zap.Int("current running applications",
len(childQueueTracker.runningApplications)),
+ zap.Uint64("config max applications", count))
+ return fmt.Errorf("current running applications is greater than
config max applications for %s", queuePath)
+ } else {
+ childQueueTracker.maxRunningApps = count
+ }
+ return nil
+}
+
+func (qt *QueueTracker) setMaxResources(resource *resources.Resource,
queuePath string) error {
Review Comment:
AH ok, I just checked the commits, this PR contains commits from other
PRs... Let's fix those first because I ended up reviewing the same code again.
--
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]