-
Notifications
You must be signed in to change notification settings - Fork 128
/
scheduling.go
36 lines (33 loc) · 1.24 KB
/
scheduling.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package types
import "golang.org/x/exp/maps"
type PriorityClass struct {
Priority int32
// If true, Armada may preempt jobs of this class to improve fairness.
Preemptible bool
// Limits resources assigned to jobs of this priority class.
// Specifically, jobs of this priority class are only scheduled if doing so does not exceed this limit.
MaximumResourceFractionPerQueue map[string]float64
// Per-pool override of MaximumResourceFractionPerQueue.
// If missing for a particular pool, MaximumResourceFractionPerQueue is used instead for that pool.
MaximumResourceFractionPerQueueByPool map[string]map[string]float64
}
func (priorityClass PriorityClass) Equal(other PriorityClass) bool {
if priorityClass.Priority != other.Priority {
return false
}
if priorityClass.Preemptible != other.Preemptible {
return false
}
if !maps.Equal(priorityClass.MaximumResourceFractionPerQueue, other.MaximumResourceFractionPerQueue) {
return false
}
if len(priorityClass.MaximumResourceFractionPerQueueByPool) != len(other.MaximumResourceFractionPerQueueByPool) {
return false
}
for k, v := range priorityClass.MaximumResourceFractionPerQueueByPool {
if !maps.Equal(v, other.MaximumResourceFractionPerQueueByPool[k]) {
return false
}
}
return true
}