schedulerapi

package
v0.35.0-beta.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

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]
	AllocatedSharedDeviceIDs sets.Set[SharedDeviceID]
	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

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

Clone makes a copy of ConsumedCapacity of each capacity.

func (ConsumedCapacityCollection) Insert

Insert adds a new allocated capacity to the collection.

func (ConsumedCapacityCollection) Remove

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

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

func MakeDeviceID(driver, pool, device string) DeviceID

MakeDeviceID creates a new DeviceID from driver, pool, and device names. This function is used in the scheduler and autoscaler contract.

func (DeviceID) String

func (d DeviceID) String() string

type SharedDeviceID

type SharedDeviceID struct {
	Driver, Pool, Device, ShareID draapi.UniqueString
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL