cache

package
v0.0.0-...-44dad58 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equals

func Equals(a v1.ResourceList, b v1.ResourceList) bool

func GetLeastFitSliceNum

func GetLeastFitSliceNum(quota, quotaSlice v1.ResourceList) (int, error)

Types

type Cache

type Cache interface {
	AddTenant(string)
	RemoveTenant(string) error
	GetNamespace(string) *Namespace
	AddNamespace(*Namespace) error
	RemoveNamespace(*Namespace) error
	UpdateNamespace(*Namespace, *Namespace) error
	AddCluster(*Cluster) error
	RemoveCluster(string) error
	GetPod(string) *Pod
	AddPod(*Pod) error
	RemovePod(*Pod) error
	AddProvision(string, string, []*Slice) error
	RemoveProvision(string, string) error
	UpdateClusterCapacity(string, v1.ResourceList) error
	SnapshotForNamespaceSched(...*Namespace) (*NamespaceSchedSnapshot, error)
	SnapshotForPodSched(pod *Pod) (*PodSchedSnapshot, error)
	Dump() string
}

func NewSchedulerCache

func NewSchedulerCache(stop <-chan struct{}) Cache

type Cluster

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

func NewCluster

func NewCluster(name string, labels map[string]string, capacity v1.ResourceList) *Cluster

func (*Cluster) AddNamespace

func (c *Cluster) AddNamespace(key string, slices []*Slice) error

func (*Cluster) AddPod

func (c *Cluster) AddPod(pod *Pod) error

func (*Cluster) AddProvision

func (c *Cluster) AddProvision(key string, slices []*Slice) error

func (*Cluster) DeepCopy

func (c *Cluster) DeepCopy() *Cluster

func (*Cluster) Dump

func (c *Cluster) Dump() string

func (*Cluster) RemoveNamespace

func (c *Cluster) RemoveNamespace(key string) error

func (*Cluster) RemovePod

func (c *Cluster) RemovePod(pod *Pod)

func (*Cluster) RemoveProvision

func (c *Cluster) RemoveProvision(key string) error

type ClusterUsage

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

func (*ClusterUsage) GetCapacity

func (u *ClusterUsage) GetCapacity() v1.ResourceList

func (*ClusterUsage) GetMaxAlloc

func (u *ClusterUsage) GetMaxAlloc() v1.ResourceList

type Namespace

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

func NewNamespace

func NewNamespace(owner, name string, labels map[string]string, quota, quotaSlice v1.ResourceList, schedule []*Placement) *Namespace

func (*Namespace) Comparable

func (n *Namespace) Comparable(in *Namespace) bool

func (*Namespace) DeepCopy

func (n *Namespace) DeepCopy() *Namespace

func (*Namespace) Dump

func (n *Namespace) Dump() string

func (*Namespace) GetKey

func (n *Namespace) GetKey() string

func (*Namespace) GetPlacementMap

func (n *Namespace) GetPlacementMap() map[string]int

func (*Namespace) GetQuotaSlice

func (n *Namespace) GetQuotaSlice() v1.ResourceList

func (*Namespace) GetTotalSlices

func (n *Namespace) GetTotalSlices() int

func (*Namespace) SetNewPlacements

func (n *Namespace) SetNewPlacements(p map[string]int)

type NamespaceSchedSnapshot

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

func NewNamespaceSchedSnapshot

func NewNamespaceSchedSnapshot() *NamespaceSchedSnapshot

func (*NamespaceSchedSnapshot) AddSlices

func (s *NamespaceSchedSnapshot) AddSlices(slices []*Slice) error

func (*NamespaceSchedSnapshot) GetClusterUsageMap

func (s *NamespaceSchedSnapshot) GetClusterUsageMap() map[string]*ClusterUsage

func (*NamespaceSchedSnapshot) RemoveSlices

func (s *NamespaceSchedSnapshot) RemoveSlices(slices []*Slice) error

type Placement

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

func NewPlacement

func NewPlacement(cluster string, num int) *Placement

func (*Placement) GetCluster

func (p *Placement) GetCluster() string

func (*Placement) GetNum

func (p *Placement) GetNum() int

func (Placement) MarshalJSON

func (p Placement) MarshalJSON() ([]byte, error)

func (Placement) String

func (p Placement) String() string

type Pod

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

func NewPod

func NewPod(owner, namespace, name, cluster string, request v1.ResourceList) *Pod

func (*Pod) DeepCopy

func (p *Pod) DeepCopy() *Pod

func (*Pod) Dump

func (p *Pod) Dump() string

func (*Pod) GetCluster

func (p *Pod) GetCluster() string

func (*Pod) GetKey

func (p *Pod) GetKey() string

func (*Pod) GetNamespaceKey

func (p *Pod) GetNamespaceKey() string

func (*Pod) GetRequest

func (p *Pod) GetRequest() v1.ResourceList

func (*Pod) SetCluster

func (p *Pod) SetCluster(cluster string)

type PodSchedSnapshot

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

func NewPodSchedSnapshot

func NewPodSchedSnapshot() *PodSchedSnapshot

func (*PodSchedSnapshot) AddUsage

func (s *PodSchedSnapshot) AddUsage(cluster string, usage v1.ResourceList) error

func (*PodSchedSnapshot) GetClusterUsageMap

func (s *PodSchedSnapshot) GetClusterUsageMap() map[string]*ClusterUsage

type Slice

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

func NewSlice

func NewSlice(owner string, sliceSize v1.ResourceList, cluster string) *Slice

func (Slice) DeepCopy

func (s Slice) DeepCopy() *Slice

func (Slice) MarshalJSON

func (s Slice) MarshalJSON() ([]byte, error)

func (Slice) String

func (s Slice) String() string

Jump to

Keyboard shortcuts

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