Documentation ¶
Index ¶
- type CPUClassPartition
- type CPUCoresPartition
- type Mapping
- func (m *Mapping) FirstGUIDOffer(resources Resources) (*guid.GUID, error)
- func (m *Mapping) HigherRandGUIDSearch(currentGUID guid.GUID, targetResources Resources) (*guid.GUID, error)
- func (m *Mapping) LowerPartitionsOffer(availableResources Resources) ([]Resources, error)
- func (m *Mapping) LowerRandGUIDOffer(currentGUID guid.GUID, targetResources Resources) (*guid.GUID, error)
- func (m *Mapping) LowerRandGUIDSearch(currentGUID guid.GUID, targetResources Resources) (*guid.GUID, error)
- func (m *Mapping) LowestResources() *Resources
- func (m *Mapping) RandGUIDFittestSearch(targetResources Resources) (*guid.GUID, error)
- func (m *Mapping) RandGUIDHighestSearch(targetResources Resources) (*guid.GUID, error)
- func (m *Mapping) RandGUIDOffer(targetResources Resources) (*guid.GUID, error)
- func (m *Mapping) ResourcesByGUID(resGUID guid.GUID) *Resources
- func (m *Mapping) SamePartitionResourcesSearch(arg1 Resources, arg2 Resources) (bool, error)
- type MemoryPartition
- type ResourcePartition
- type ResourcePartitions
- type Resources
- func (r *Resources) Add(resources Resources)
- func (r *Resources) AddCPUs(cpus int)
- func (r *Resources) AddMemory(memory int)
- func (r *Resources) CPUClass() int
- func (r *Resources) CPUs() int
- func (r *Resources) Contains(contained Resources) bool
- func (r *Resources) Copy() *Resources
- func (r *Resources) Equals(resources Resources) bool
- func (r *Resources) IsNegative() bool
- func (r *Resources) IsValid() bool
- func (r *Resources) IsZero() bool
- func (r *Resources) Memory() int
- func (r *Resources) SetCPUClass(cpuClass int)
- func (r *Resources) SetCPUs(cpu int)
- func (r *Resources) SetMemory(memory int)
- func (r *Resources) SetTo(resources Resources)
- func (r *Resources) SetZero()
- func (r *Resources) String() string
- func (r *Resources) Sub(resources Resources)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CPUClassPartition ¶
type CPUClassPartition struct { ResourcePartition // contains filtered or unexported fields }
func (*CPUClassPartition) CPUCoresPartitions ¶
func (c *CPUClassPartition) CPUCoresPartitions() []ResourcePartition
func (*CPUClassPartition) CPUCoresPercentages ¶
func (c *CPUClassPartition) CPUCoresPercentages() []int
type CPUCoresPartition ¶
type CPUCoresPartition struct { ResourcePartition // contains filtered or unexported fields }
func (*CPUCoresPartition) MemoryPartitions ¶
func (c *CPUCoresPartition) MemoryPartitions() []ResourcePartition
func (*CPUCoresPartition) MemoryPercentages ¶
func (c *CPUCoresPartition) MemoryPercentages() []int
type Mapping ¶
type Mapping struct {
// contains filtered or unexported fields
}
Mapping ...
func NewResourcesMap ¶
func NewResourcesMap(partitions *ResourcePartitions, pseudoSuperPeer bool) *Mapping
NewResourcesMap creates a new resource map given the CPUs and Memory partitions and the respective GUID distributions.
func (*Mapping) FirstGUIDOffer ¶
FirstGUIDOffer returns the first GUID that represents the given resources.
func (*Mapping) HigherRandGUIDSearch ¶
func (m *Mapping) HigherRandGUIDSearch(currentGUID guid.GUID, targetResources Resources) (*guid.GUID, error)
HigherRandGUIDSearch returns a random GUID in the next range of resources. First it tries the GUIDs that represent the SAME cpus and MORE memory. Second it tries the GUIDs that represent the MORE cpus and SAME memory. Lastly it will try the GUIDs that represent the MORE cpus and MORE memory.
func (*Mapping) LowerPartitionsOffer ¶
LowerPartitionsOffer
func (*Mapping) LowerRandGUIDOffer ¶
func (m *Mapping) LowerRandGUIDOffer(currentGUID guid.GUID, targetResources Resources) (*guid.GUID, error)
LowerRandGUIDOffer returns a random GUID in the previous range of resources. First it tries the GUIDs that represent the SAME cpus and LESS memory. Second it tries the GUIDs that represent the LESS cpus and SAME memory. Lastly it will try the GUIDs that represent the LESS cpus and LESS memory.
func (*Mapping) LowerRandGUIDSearch ¶
func (*Mapping) LowestResources ¶
LowestResources returns the lowest resource combination available.
func (*Mapping) RandGUIDFittestSearch ¶
RandGUIDFittestSearch returns a random GUID in the range of the respective "fittest" target resource combination.
func (*Mapping) RandGUIDHighestSearch ¶
func (*Mapping) RandGUIDOffer ¶
RandGUIDOffer returns a random GUID in the range of the respective "fittest" target resource combination.
func (*Mapping) ResourcesByGUID ¶
ResourcesByGUID returns the resources combination that maps to the given GUID.
type MemoryPartition ¶
type MemoryPartition struct {
ResourcePartition
}
type ResourcePartition ¶
Partition of a given resource through a percentage.
type ResourcePartitions ¶
type ResourcePartitions struct {
// contains filtered or unexported fields
}
func ObtainConfiguredPartitions ¶
func ObtainConfiguredPartitions(configPartitions configuration.ResourcesPartitions) *ResourcePartitions
func (*ResourcePartitions) CPUClassPartitions ¶
func (r *ResourcePartitions) CPUClassPartitions() []ResourcePartition
func (*ResourcePartitions) CPUClassPercentages ¶
func (r *ResourcePartitions) CPUClassPercentages() []int
type Resources ¶
type Resources struct {
// contains filtered or unexported fields
}
FreeResources represent of the resources that a user can ask for a container to have available.
func NewResources ¶
func NewResourcesCPUClass ¶
NewResourcesCPUClass creates a new resource combination object.
func (*Resources) Contains ¶
Contains returns true if the given resources are contained inside the receiver.
func (*Resources) Equals ¶
Equals returns true if the given resource combination is equal to the receiver.
func (*Resources) IsNegative ¶
IsNegative return true if one of the resources has a negative amount.
func (*Resources) SetCPUClass ¶
SetCPUClass CPU Class setter.