@@ -32,14 +32,14 @@ import (
3232 "github.com/apache/yunikorn-core/pkg/log"
3333)
3434
35- // The configuration can contain multiple partitions. Each partition contains the queue definition for a logical
35+ // SchedulerConfig can contain multiple partitions. Each partition contains the queue definition for a logical
3636// set of scheduler resources.
3737type SchedulerConfig struct {
3838 Partitions []PartitionConfig
3939 Checksum string `yaml:",omitempty" json:",omitempty"`
4040}
4141
42- // The partition object for each partition:
42+ // PartitionConfig for each partition:
4343// - the name of the partition
4444// - a list of sub or child queues
4545// - a list of placement rule definition objects
@@ -60,12 +60,13 @@ type UserGroupResolver struct {
6060 Type string `yaml:"type,omitempty" json:"type,omitempty"`
6161}
6262
63- // The partition preemption configuration
63+ // PartitionPreemptionConfig defines global flags for both preemption types
6464type PartitionPreemptionConfig struct {
65- Enabled * bool `yaml:",omitempty" json:",omitempty"`
65+ Enabled * bool `yaml:",omitempty" json:",omitempty"`
66+ QuotaPreemptionEnabled * bool `yaml:",omitempty" json:",omitempty"`
6667}
6768
68- // The queue object for each queue:
69+ // QueueConfig object for each queue:
6970// - the name of the queue
7071// - a resources object to specify resource limits on the queue
7172// - the maximum number of applications that can run in the queue
@@ -84,20 +85,16 @@ type QueueConfig struct {
8485 ChildTemplate ChildTemplate `yaml:",omitempty" json:",omitempty"`
8586 Queues []QueueConfig `yaml:",omitempty" json:",omitempty"`
8687 Limits []Limit `yaml:",omitempty" json:",omitempty"`
87- Preemption Preemption `yaml:",omitempty" json:",omitempty"`
88- }
89-
90- type Preemption struct {
91- Delay uint64 `yaml:",omitempty" json:",omitempty"`
9288}
9389
90+ // ChildTemplate set on a parent queue with settings to be applied to the child created via a placement rule.
9491type ChildTemplate struct {
9592 MaxApplications uint64 `yaml:",omitempty" json:",omitempty"`
9693 Properties map [string ]string `yaml:",omitempty" json:",omitempty"`
9794 Resources Resources `yaml:",omitempty" json:",omitempty"`
9895}
9996
100- // The resource limits to set on the queue. The definition allows for an unlimited number of types to be used.
97+ // The Resources limit to apply on the queue. The definition allows for an unlimited number of types to be used.
10198// The mapping to "known" resources is not handled here.
10299// - guaranteed resources
103100// - max resources
@@ -106,12 +103,12 @@ type Resources struct {
106103 Max map [string ]string `yaml:",omitempty" json:",omitempty"`
107104}
108105
109- // The queue placement rule definition
106+ // The PlacementRule definition:
110107// - the name of the rule
111108// - create flag: can the rule create a queue
112109// - user and group filter to be applied on the callers
113110// - rule link to allow setting a rule to generate the parent
114- // - value a generic value interpreted depending on the rule type (i.e queue name for the "fixed" rule
111+ // - value a generic value interpreted depending on the rule type (i.e. queue name for the "fixed" rule
115112// or the application label name for the "tag" rule)
116113type PlacementRule struct {
117114 Name string
@@ -121,7 +118,7 @@ type PlacementRule struct {
121118 Value string `yaml:",omitempty" json:",omitempty"`
122119}
123120
124- // The user and group filter for a rule .
121+ // Filter for users and groups for a PlacementRule .
125122// - type of filter (allow or deny filter, empty means allow)
126123// - list of users to filter (maybe empty)
127124// - list of groups to filter (maybe empty)
@@ -132,13 +129,13 @@ type Filter struct {
132129 Groups []string `yaml:",omitempty" json:",omitempty"`
133130}
134131
135- // A list of limit objects to define limits for a partition or queue
132+ // Limits is a list of Limit objects to define user and group limits for a partition or queue.
136133type Limits struct {
137134 Limit []Limit
138135}
139136
140- // The limit object to specify user and or group limits at different levels in the partition or queues
141- // Different limits for the same user or group may be defined at different levels in the hierarchy
137+ // A Limit object to specify user and or group limits at different levels in the partition or queues.
138+ // Different limits for the same user or group may be defined at different levels in the hierarchy:
142139// - limit description (optional)
143140// - list of users (maybe empty)
144141// - list of groups (maybe empty)
@@ -152,8 +149,10 @@ type Limit struct {
152149 MaxApplications uint64 `yaml:",omitempty" json:",omitempty"`
153150}
154151
155- // Global Node Sorting Policy section
156- // - type: different type of policies supported (binpacking, fair etc)
152+ // NodeSortingPolicy to be applied globally.
153+ // - type: different type of policies supported (binpacking, fair etc.)
154+ // - resource weight: factor to be applied to comparisons of different resource types when sorting nodes. Types not
155+ // mentioned have a weight of 1.0.
157156type NodeSortingPolicy struct {
158157 Type string
159158 ResourceWeights map [string ]float64 `yaml:",omitempty" json:",omitempty"`
0 commit comments