reservation

package
v0.0.0-...-bc30bd0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeReservationInfo

type NodeReservationInfo struct {
	// contains filtered or unexported fields
}

NodeReservationInfo is a collection of reservationInfo belong to the same node

func NewCacheNodeReservationInfo

func NewCacheNodeReservationInfo() *NodeReservationInfo

func NewSnapshotNodeReservationInfo

func NewSnapshotNodeReservationInfo() *NodeReservationInfo

func (*NodeReservationInfo) DeleteReservationInfoGroup

func (n *NodeReservationInfo) DeleteReservationInfoGroup(placeholder string)

func (*NodeReservationInfo) GetGeneration

func (n *NodeReservationInfo) GetGeneration() int64

func (*NodeReservationInfo) GetStore

func (*NodeReservationInfo) Keys

func (n *NodeReservationInfo) Keys() []string

func (*NodeReservationInfo) SetGeneration

func (n *NodeReservationInfo) SetGeneration(generation int64)

func (*NodeReservationInfo) SetReservationInfoGroup

func (n *NodeReservationInfo) SetReservationInfoGroup(placeholder string, group *ReservationInfoGroup)

func (*NodeReservationInfo) UpdateSnapshot

func (n *NodeReservationInfo) UpdateSnapshot(snapshot *NodeReservationInfo, cloneFunc generationstore.CloneFunc, cleanFunc generationstore.CleanFunc)

type NodeReservationStore

type NodeReservationStore struct {
	// contains filtered or unexported fields
}

func NewCacheNodeReservationStore

func NewCacheNodeReservationStore() *NodeReservationStore

func NewSnapshotNodeReservationStore

func NewSnapshotNodeReservationStore() *NodeReservationStore

func (*NodeReservationStore) AddReservationInfo

func (r *NodeReservationStore) AddReservationInfo(info *ReservationInfo)

func (*NodeReservationStore) ConditionRange

func (r *NodeReservationStore) ConditionRange(f func(key string, nodeInfo *NodeReservationInfo) bool) bool

func (*NodeReservationStore) DeleteNodeReservationInfo

func (r *NodeReservationStore) DeleteNodeReservationInfo(nodeName string)

func (*NodeReservationStore) DeleteReservationInfo

func (r *NodeReservationStore) DeleteReservationInfo(id *ReservationIdentifier)

func (*NodeReservationStore) GetAvailablePlaceholderPods

func (r *NodeReservationStore) GetAvailablePlaceholderPods(placeholder string) (api.ReservationPlaceholdersOfNodes, error)

func (*NodeReservationStore) GetAvailablePlaceholderPodsOnNode

func (r *NodeReservationStore) GetAvailablePlaceholderPodsOnNode(nodeName, placeholder string) (api.ReservationPlaceholderMap, error)

func (*NodeReservationStore) GetNodeReservationInfo

func (r *NodeReservationStore) GetNodeReservationInfo(nodeName string) *NodeReservationInfo

func (*NodeReservationStore) GetReservationInfo

func (r *NodeReservationStore) GetReservationInfo(id *ReservationIdentifier) *ReservationInfo

func (*NodeReservationStore) Len

func (r *NodeReservationStore) Len() int

func (*NodeReservationStore) SetMatchedPodForReservation

func (r *NodeReservationStore) SetMatchedPodForReservation(id *ReservationIdentifier, matchedPod *v1.Pod) error

func (*NodeReservationStore) SetNodeReservationInfo

func (r *NodeReservationStore) SetNodeReservationInfo(nodeName string, nodeInfo *NodeReservationInfo)

func (*NodeReservationStore) UpdateSnapshot

type ReservationIdentifier

type ReservationIdentifier struct {
	// contains filtered or unexported fields
}

func GetReservationIdentifier

func GetReservationIdentifier(p *v1.Pod) (*ReservationIdentifier, error)

func (*ReservationIdentifier) Clone

func (*ReservationIdentifier) String

func (id *ReservationIdentifier) String() string

type ReservationInfo

type ReservationInfo struct {
	*ReservationIdentifier
	// original podKey.
	PlaceholderPod *v1.Pod

	// mark the timestamp, if timeout, reservation will be stopped
	// and pod resources will be released.
	CreateTime time.Time

	// TODO: revisit this filed, can we remove this field and use Status instead
	MatchedPod *v1.Pod
}

ReservationInfo holds the information of reservation

func NewReservationInfo

func NewReservationInfo(placeholderPod, matchedPod *v1.Pod) (*ReservationInfo, error)

func (*ReservationInfo) IsAvailable

func (ri *ReservationInfo) IsAvailable() bool

type ReservationInfoGroup

type ReservationInfoGroup struct {
	// contains filtered or unexported fields
}

ReservationInfoGroup is a collection of ReservationInfo belong to the same placeholder

func NewReservationInfoGroup

func NewReservationInfoGroup() *ReservationInfoGroup

func (*ReservationInfoGroup) Clone

func (*ReservationInfoGroup) GetGeneration

func (r *ReservationInfoGroup) GetGeneration() int64

func (*ReservationInfoGroup) SetGeneration

func (r *ReservationInfoGroup) SetGeneration(generation int64)

Jump to

Keyboard shortcuts

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