pbacsko commented on code in PR #935:
URL: https://github.com/apache/yunikorn-core/pull/935#discussion_r1715427610
##########
pkg/scheduler/objects/queue.go:
##########
@@ -1220,6 +1220,50 @@ func (sq *Queue) GetMaxResource() *resources.Resource {
return sq.internalGetMax(limit)
}
+// GetFairMaxResource computes the fair max resources for a given queue.
+// 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 {
+ cleaned := resources.NewResource()
+ if sq.maxResource == nil {
+ return cleaned
+ }
+
+ for k, v := range sq.maxResource.Resources {
+ if v != 0 {
+ cleaned.Resources[k] = v
+ }
+ }
Review Comment:
Thx, good to know.
--
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]