pbacsko commented on code in PR #935:
URL: https://github.com/apache/yunikorn-core/pull/935#discussion_r1709999416
##########
pkg/scheduler/objects/queue.go:
##########
@@ -1220,6 +1220,63 @@ func (sq *Queue) GetMaxResource() *resources.Resource {
return sq.internalGetMax(limit)
}
+// Starting with the root, descend down to the target queue allowing children
to override Resource values .
+// If the root includes an explicit 0 value for a Resource, do not include it
in the accumulator and treat it as missing.
+// If no children provide a maximum capacity override, the resulting value
will be the value found on the Root.
+// It is useful for fair-scheduling to allow a ratio to be produced
representing the rough utilization % of a given queue.
+func (sq *Queue) GetFairMaxResource() *resources.Resource {
+ var limit *resources.Resource
+ if sq.parent == nil {
+ cleanedRootResources := resources.NewResource()
+ if sq.maxResource == nil {
+ return cleanedRootResources
Review Comment:
Please check this: if you always return an empty resource, then the `if
parent == nil` will never be false in `internalGetFairMaxResource()` because it
will propagate towards the lower part of the hierarchy. You can verify this
with the code coverage as well ("make test" generates coverage report in
`build/coverage.txt`) - certain branches are never taken.
--
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]