Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllocatedState ¶
type AllocatedState struct {
AllocatedDevices sets.Set[DeviceID]
AggregatedCapacity ConsumedCapacityCollection
}
AllocatedState represents the current state of allocated resources. This type is used in the scheduler and autoscaler contract. AllocatedState packs information of allocated devices which is gathered from allocated resource claims.
type ConsumedCapacity ¶
type ConsumedCapacity map[resourceapi.QualifiedName]*resource.Quantity
ConsumedCapacity represents the consumed capacity of a specific resource. This type is used in consumable capacity features and the scheduler. ConsumedCapacity defines consumable capacity values
func NewConsumedCapacity ¶
func NewConsumedCapacity() ConsumedCapacity
NewConsumedCapacity creates a new ConsumedCapacity. This function is used in consumable capacity features and the scheduler. NewConsumedCapacity initiates a new map of consumable capacity values
func (ConsumedCapacity) Add ¶
func (s ConsumedCapacity) Add(addedCapacity ConsumedCapacity)
Add adds quantity to corresponding consumable capacity, and creates a new entry if no capacity created yet.
func (ConsumedCapacity) Clone ¶
func (s ConsumedCapacity) Clone() ConsumedCapacity
Clone makes a copy of consumed capacity values
func (ConsumedCapacity) Empty ¶
func (s ConsumedCapacity) Empty() bool
Empty return true if all quantity is zero.
func (ConsumedCapacity) Sub ¶
func (s ConsumedCapacity) Sub(subtractedCapacity ConsumedCapacity)
Sub subtracts quantity, and ignore if no capacity entry found.
type ConsumedCapacityCollection ¶
type ConsumedCapacityCollection map[DeviceID]ConsumedCapacity
ConsumedCapacityCollection represents a collection of consumed capacities. This type is used in consumable capacity features and the scheduler. ConsumedCapacityCollection collects consumable capacity values of each device
func NewConsumedCapacityCollection ¶
func NewConsumedCapacityCollection() ConsumedCapacityCollection
NewConsumedCapacityCollection creates a new ConsumedCapacityCollection. This function is used in consumable capacity features and the scheduler. NewConsumedCapacityCollection initiates a new map of device's consumable capacity values
func (ConsumedCapacityCollection) Clone ¶
func (c ConsumedCapacityCollection) Clone() ConsumedCapacityCollection
Clone makes a copy of ConsumedCapacity of each capacity.
func (ConsumedCapacityCollection) Insert ¶
func (c ConsumedCapacityCollection) Insert(cap DeviceConsumedCapacity)
Insert adds a new allocated capacity to the collection.
func (ConsumedCapacityCollection) Remove ¶
func (c ConsumedCapacityCollection) Remove(cap DeviceConsumedCapacity)
Remove removes an allocated capacity from the collection.
type DeviceConsumedCapacity ¶
type DeviceConsumedCapacity struct {
DeviceID
ConsumedCapacity
}
DeviceConsumedCapacity represents the consumed capacity of a device. This type is used in consumable capacity features and the scheduler. DeviceConsumedCapacity contains consumed capacity result within device allocation.
func NewDeviceConsumedCapacity ¶
func NewDeviceConsumedCapacity(deviceID DeviceID, consumedCapacity map[resourceapi.QualifiedName]resource.Quantity) DeviceConsumedCapacity
NewDeviceConsumedCapacity creates a new DeviceConsumedCapacity. This function is used in consumable capacity features and the scheduler. NewDeviceConsumedCapacity creates DeviceConsumedCapacity instance from device ID and its consumed capacity.
func (DeviceConsumedCapacity) Clone ¶
func (a DeviceConsumedCapacity) Clone() DeviceConsumedCapacity
Clone makes a copy of DeviceConsumedCapacity.
func (DeviceConsumedCapacity) String ¶
func (a DeviceConsumedCapacity) String() string
String returns formatted device ID.
type DeviceID ¶
type DeviceID struct {
Driver, Pool, Device draapi.UniqueString
}
DeviceID represents a unique identifier for a device in the DRA system. This type is used in the scheduler and autoscaler contract.
func MakeDeviceID ¶
MakeDeviceID creates a new DeviceID from driver, pool, and device names. This function is used in the scheduler and autoscaler contract.
type SharedDeviceID ¶
type SharedDeviceID struct {
SharedDeviceID represents a shared device allocation. This type is used in consumable capacity features and the scheduler.
func MakeSharedDeviceID ¶
func MakeSharedDeviceID(deviceID DeviceID, shareID *types.UID) SharedDeviceID
MakeSharedDeviceID creates a new SharedDeviceID from a DeviceID and share ID. This function is used in consumable capacity features and the scheduler.
func (SharedDeviceID) String ¶
func (d SharedDeviceID) String() string