Documentation ¶
Index ¶
- Constants
- func GetInputSchedtagByType(tags []*computeapi.SchedtagConfig, types ...string) []*computeapi.SchedtagConfig
- func GetRequestSchedtags(reqTags []*computeapi.SchedtagConfig, allTags []schedtag.ISchedtag) (requireTags, execludeTags, preferTags, avoidTags []computeapi.SchedtagConfig)
- func GetSchedtagCount(inTags []computeapi.SchedtagConfig, objTags []schedtag.ISchedtag, ...) (countMap map[string]int)
- func IsNetworkAvailable(ctx context.Context, c core.Candidater, data *api.SchedInfo, ...) core.PredicateFailureReason
- func IsNetworksAvailable(ctx context.Context, c core.Candidater, data *api.SchedInfo, ...) (int, []core.PredicateFailureReason)
- func NewCloudproviderSchedtagPredicate() core.FitPredicate
- func NewCloudregionSchedtagPredicate() core.FitPredicate
- func NewHostSchedtagPredicate() core.FitPredicate
- func NewZoneSchedtagPredicate() core.FitPredicate
- func SetCandidateScoreBySchedtag(u *core.Unit, c core.Candidater, aggCountMap map[string]int, prefer bool)
- type BasePredicate
- type BaseSchedtagPredicate
- func (p *BaseSchedtagPredicate) Execute(ctx context.Context, sp ISchedtagPredicateInstance, u *core.Unit, ...) (bool, []core.PredicateFailureReason, error)
- func (p *BaseSchedtagPredicate) GetHypervisorDriver() models.IGuestDriver
- func (p *BaseSchedtagPredicate) GetInputResourcesMap(candidateId string) SchedtagInputResourcesMap
- func (p *BaseSchedtagPredicate) OnPriorityEnd(sp ISchedtagPredicateInstance, u *core.Unit, c core.Candidater)
- func (p *BaseSchedtagPredicate) OnSelectEnd(sp ISchedtagPredicateInstance, u *core.Unit, c core.Candidater, count int64)
- func (p *BaseSchedtagPredicate) PreExecute(ctx context.Context, sp ISchedtagPredicateInstance, u *core.Unit, ...) (bool, error)
- type CandidateInputResourcesMap
- type ClassMetadataPredicate
- func (p *ClassMetadataPredicate) Clone() core.FitPredicate
- func (p *ClassMetadataPredicate) Execute(ctx context.Context, u *core.Unit, c core.Candidater) (bool, []core.PredicateFailureReason, error)
- func (p *ClassMetadataPredicate) Name() string
- func (p *ClassMetadataPredicate) PreExecute(ctx context.Context, u *core.Unit, cs []core.Candidater) (bool, error)
- type CloudproviderSchedtagPredicate
- func (p *CloudproviderSchedtagPredicate) Clone() core.FitPredicate
- func (p *CloudproviderSchedtagPredicate) GetCandidateResource(c core.Candidater) ISchedtagCandidateResource
- func (p *CloudproviderSchedtagPredicate) GetInputs(u *core.Unit) []ISchedtagCustomer
- func (p *CloudproviderSchedtagPredicate) Name() string
- func (p *CloudproviderSchedtagPredicate) PreExecute(ctx context.Context, u *core.Unit, cs []core.Candidater) (bool, error)
- type CloudregionSchedtagPredicate
- func (p *CloudregionSchedtagPredicate) Clone() core.FitPredicate
- func (p *CloudregionSchedtagPredicate) GetCandidateResource(c core.Candidater) ISchedtagCandidateResource
- func (p *CloudregionSchedtagPredicate) GetInputs(u *core.Unit) []ISchedtagCustomer
- func (p *CloudregionSchedtagPredicate) Name() string
- type DiskSchedtagPredicate
- func (p *DiskSchedtagPredicate) AddSelectResult(index int, input ISchedtagCustomer, selectRes []ISchedtagCandidateResource, ...)
- func (p *DiskSchedtagPredicate) Clone() core.FitPredicate
- func (p *DiskSchedtagPredicate) DoSelect(c core.Candidater, input ISchedtagCustomer, res []ISchedtagCandidateResource) []ISchedtagCandidateResource
- func (p *DiskSchedtagPredicate) Execute(ctx context.Context, u *core.Unit, c core.Candidater) (bool, []core.PredicateFailureReason, error)
- func (p *DiskSchedtagPredicate) GetCandidateResourceSortScore(selectRes ISchedtagCandidateResource) int64
- func (p *DiskSchedtagPredicate) GetInputs(u *core.Unit) []ISchedtagCustomer
- func (p *DiskSchedtagPredicate) GetResources(c core.Candidater) []ISchedtagCandidateResource
- func (p *DiskSchedtagPredicate) GetUsedStorages(res []ISchedtagCandidateResource, backend string) []ISchedtagCandidateResource
- func (p *DiskSchedtagPredicate) IsResourceFitInput(ctx context.Context, u *core.Unit, c core.Candidater, ...) core.PredicateFailureReason
- func (p *DiskSchedtagPredicate) IsResourceMatchInput(ctx context.Context, input ISchedtagCustomer, res ISchedtagCandidateResource) bool
- func (p *DiskSchedtagPredicate) Name() string
- func (p *DiskSchedtagPredicate) OnPriorityEnd(u *core.Unit, c core.Candidater)
- func (p *DiskSchedtagPredicate) OnSelectEnd(u *core.Unit, c core.Candidater, count int64)
- func (p *DiskSchedtagPredicate) PreExecute(ctx context.Context, u *core.Unit, cs []core.Candidater) (bool, error)
- type DomainPredicate
- type FailReason
- type HostSchedtagPredicate
- type INetworkNicCountGetter
- type ISchedtagCandidate
- type ISchedtagCandidateResource
- type ISchedtagCustomer
- type ISchedtagPredicate
- type ISchedtagPredicateInstance
- type InstanceTypePredicate
- func (p *InstanceTypePredicate) Clone() core.FitPredicate
- func (p *InstanceTypePredicate) Execute(ctx context.Context, u *core.Unit, c core.Candidater) (bool, []core.PredicateFailureReason, error)
- func (p *InstanceTypePredicate) Name() string
- func (p *InstanceTypePredicate) PreExecute(ctx context.Context, u *core.Unit, cs []core.Candidater) (bool, error)
- type InsufficientResourceError
- type IsolatedDevicePredicate
- func (f *IsolatedDevicePredicate) Clone() core.FitPredicate
- func (f *IsolatedDevicePredicate) Execute(ctx context.Context, u *core.Unit, c core.Candidater) (bool, []core.PredicateFailureReason, error)
- func (f *IsolatedDevicePredicate) Name() string
- func (f *IsolatedDevicePredicate) PreExecute(ctx context.Context, u *core.Unit, cs []core.Candidater) (bool, error)
- type NetworkPredicate
- func (p *NetworkPredicate) Clone() core.FitPredicate
- func (p *NetworkPredicate) Execute(ctx context.Context, u *core.Unit, c core.Candidater) (bool, []core.PredicateFailureReason, error)
- func (p *NetworkPredicate) GetNetworkTypes(u *core.Unit, specifyType computeapi.TNetworkType) []computeapi.TNetworkType
- func (p *NetworkPredicate) Name() string
- func (p *NetworkPredicate) PreExecute(ctx context.Context, u *core.Unit, cs []core.Candidater) (bool, error)
- func (p *NetworkPredicate) WithNetworkCountGetter(getter INetworkNicCountGetter) *NetworkPredicate
- type NetworkSchedtagPredicate
- func (p *NetworkSchedtagPredicate) AddSelectResult(index int, input ISchedtagCustomer, selectRes []ISchedtagCandidateResource, ...)
- func (p *NetworkSchedtagPredicate) Clone() core.FitPredicate
- func (p *NetworkSchedtagPredicate) DoSelect(c core.Candidater, input ISchedtagCustomer, res []ISchedtagCandidateResource) []ISchedtagCandidateResource
- func (p *NetworkSchedtagPredicate) Execute(ctx context.Context, u *core.Unit, c core.Candidater) (bool, []core.PredicateFailureReason, error)
- func (p *NetworkSchedtagPredicate) GetCandidateResourceSortScore(selectRes ISchedtagCandidateResource) int64
- func (p *NetworkSchedtagPredicate) GetInputs(u *core.Unit) []ISchedtagCustomer
- func (p *NetworkSchedtagPredicate) GetNetworkTypes(specifyType computeapi.TNetworkType) []computeapi.TNetworkType
- func (p *NetworkSchedtagPredicate) GetResources(c core.Candidater) []ISchedtagCandidateResource
- func (p *NetworkSchedtagPredicate) IsResourceFitInput(ctx context.Context, u *core.Unit, c core.Candidater, ...) core.PredicateFailureReason
- func (p *NetworkSchedtagPredicate) IsResourceMatchInput(ctx context.Context, input ISchedtagCustomer, res ISchedtagCandidateResource) bool
- func (p *NetworkSchedtagPredicate) Name() string
- func (p *NetworkSchedtagPredicate) OnPriorityEnd(u *core.Unit, c core.Candidater)
- func (p *NetworkSchedtagPredicate) OnSelectEnd(u *core.Unit, c core.Candidater, count int64)
- func (p *NetworkSchedtagPredicate) PreExecute(ctx context.Context, u *core.Unit, cs []core.Candidater) (bool, error)
- type PredicateHelper
- func (h *PredicateHelper) AppendInsufficientResourceError(req, total, free int64)
- func (h *PredicateHelper) AppendPredicateFail(reason core.PredicateFailureReason)
- func (h *PredicateHelper) AppendPredicateFailMsg(reason string)
- func (h *PredicateHelper) AppendPredicateFailMsgWithType(reason string, eType string)
- func (h *PredicateHelper) Exclude(reason string)
- func (h *PredicateHelper) Exclude2(predicateName string, current, expected interface{})
- func (h *PredicateHelper) ExcludeByErrors(errs []core.PredicateFailureReason)
- func (h *PredicateHelper) GetFailedResult(err error) (bool, []core.PredicateFailureReason, error)
- func (h *PredicateHelper) GetResult() (bool, []core.PredicateFailureReason, error)
- func (h *PredicateHelper) SetCapacity(capacity int64)
- func (h *PredicateHelper) SetCapacityCounter(counter core.Counter)
- func (h *PredicateHelper) SetSelectPriority(sp int)
- func (h *PredicateHelper) UseReserved() bool
- type PredicatedSchedtagResource
- type ResourceTypePredicate
- func (p *ResourceTypePredicate) Clone() core.FitPredicate
- func (p *ResourceTypePredicate) Execute(ctx context.Context, u *core.Unit, c core.Candidater) (bool, []core.PredicateFailureReason, error)
- func (p *ResourceTypePredicate) Name() string
- func (p *ResourceTypePredicate) PreExecute(ctx context.Context, u *core.Unit, cs []core.Candidater) (bool, error)
- type ResourceWithClassMetadata
- type SQuotaPredicate
- func (p *SQuotaPredicate) Clone() core.FitPredicate
- func (p *SQuotaPredicate) Execute(ctx context.Context, u *core.Unit, c core.Candidater) (bool, []core.PredicateFailureReason, error)
- func (p *SQuotaPredicate) Name() string
- func (p *SQuotaPredicate) PreExecute(ctx context.Context, u *core.Unit, cs []core.Candidater) (bool, error)
- type SchedtagChecker
- func (c *SchedtagChecker) Check(p ISchedtagPredicate, candidate ISchedtagCandidate) error
- func (c *SchedtagChecker) Contains(objectTags []schedtag.ISchedtag, tags []computeapi.SchedtagConfig) (bool, *computeapi.SchedtagConfig)
- func (c *SchedtagChecker) GetCandidateSchedtags(candidate ISchedtagCandidate) ([]schedtag.ISchedtag, error)
- func (c *SchedtagChecker) HasIntersection(tags []computeapi.SchedtagConfig, objTags []schedtag.ISchedtag) (bool, schedtag.ISchedtag)
- type SchedtagInputResourcesMap
- type SchedtagPredicate
- func (p *SchedtagPredicate) Check(candidate ISchedtagCandidate) error
- func (p *SchedtagPredicate) GetAvoidTags() []computeapi.SchedtagConfig
- func (p *SchedtagPredicate) GetExcludeTags() []computeapi.SchedtagConfig
- func (p *SchedtagPredicate) GetPreferTags() []computeapi.SchedtagConfig
- func (p *SchedtagPredicate) GetRequireTags() []computeapi.SchedtagConfig
- type SchedtagResourceW
- type ServerBaseSchedtagPredicate
- func (p *ServerBaseSchedtagPredicate) AddSelectResult(index int, input ISchedtagCustomer, selectRes []ISchedtagCandidateResource, ...)
- func (p *ServerBaseSchedtagPredicate) DoSelect(c core.Candidater, input ISchedtagCustomer, res []ISchedtagCandidateResource) []ISchedtagCandidateResource
- func (p *ServerBaseSchedtagPredicate) Execute(ctx context.Context, u *core.Unit, c core.Candidater) (bool, []core.PredicateFailureReason, error)
- func (p *ServerBaseSchedtagPredicate) GetCandidateResourceSortScore(selectRes ISchedtagCandidateResource) int64
- func (p *ServerBaseSchedtagPredicate) GetResources(c core.Candidater) []ISchedtagCandidateResource
- func (p *ServerBaseSchedtagPredicate) IsResourceFitInput(ctx context.Context, u *core.Unit, c core.Candidater, ...) core.PredicateFailureReason
- func (p *ServerBaseSchedtagPredicate) IsResourceMatchInput(ctx context.Context, input ISchedtagCustomer, res ISchedtagCandidateResource) bool
- func (p *ServerBaseSchedtagPredicate) OnPriorityEnd(u *core.Unit, c core.Candidater)
- func (p *ServerBaseSchedtagPredicate) OnSelectEnd(u *core.Unit, c core.Candidater, count int64)
- func (p *ServerBaseSchedtagPredicate) PreExecute(ctx context.Context, u *core.Unit, cs []core.Candidater) (bool, error)
- type SortNetworks
- type UnexceptedResourceError
- type ZoneSchedtagPredicate
Constants ¶
const ( ErrServerTypeIsNotMatch = `server type is not match` ErrExitIsNotMatch = `exit is not match` ErrWireIsNotMatch = `wire is not match` ErrNoPorts = `no ports` ErrNotOwner = `not owner` ErrNoEnoughStorage = `no enough storage` ErrNoAvailableNetwork = `no available network on this host` ErrNoEnoughAvailableGPUs = `no enough available GPUs` ErrNotSupportNest = `nested function not supported` ErrRequireMvs = `require mvs` ErrRequireNoMvs = `require not mvs` ErrHostIsSpecifiedForMigration = `host_id specified for migration` ErrHostCpuModelIsNotMatchForLiveMigrate = `host cpu mode not match for live migrate` ErrHostCpuMicrocodeNotMatchForLiveMigrate = `host cpu microcode not match for live migrate` ErrHostMemPageSizeNotMatchForLiveMigrate = `host mem page size not match for live migrate` ErrHostKernelNotMatchForLiveMigrate = `host kernel not match for live migrate` ErrMoreThanOneSizeUnspecificSplit = `more than 1 size unspecific split` ErrNoMoreSpaceForUnspecificSplit = `no more space for an unspecific split` ErrSubtotalOfSplitExceedsDiskSize = `subtotal of split exceeds disk size` ErrBaremetalHasAlreadyBeenOccupied = `baremetal has already been occupied` ErrPrepaidHostOccupied = `prepaid host occupied` ErrHostCpuArchitectureNotMatch = `host cpu architecture not match` ErrUnknown = `unknown error` )
Here are all the errors that may appear in the preselection predicates.
const ( NetworkOwnership = "network_ownership" NetworkPrivate = "network_private" NetworkPublic = "network_public" NetworkTypeMatch = "network_type" NetworkMatch = "network_match" NetworkWire = "network_wire" NetworkOwner = "network_owner" NetworkDomain = "network_domain" NetworkRange = "network_range" NetworkFreeCount = "network_free_count" NetworkPort = "network_port" StorageEnable = "storage_status" StorageMatch = "storage_match" StorageType = "storage_type" StorageOwnership = "storage_ownership" StorageMedium = "storage_medium" StorageCapacity = "storage_capacity" )
Variables ¶
This section is empty.
Functions ¶
func GetInputSchedtagByType ¶
func GetInputSchedtagByType(tags []*computeapi.SchedtagConfig, types ...string) []*computeapi.SchedtagConfig
func GetRequestSchedtags ¶
func GetRequestSchedtags(reqTags []*computeapi.SchedtagConfig, allTags []schedtag.ISchedtag) (requireTags, execludeTags, preferTags, avoidTags []computeapi.SchedtagConfig)
func GetSchedtagCount ¶
func GetSchedtagCount(inTags []computeapi.SchedtagConfig, objTags []schedtag.ISchedtag, strategy string) (countMap map[string]int)
func IsNetworkAvailable ¶
func IsNetworkAvailable( ctx context.Context, c core.Candidater, data *api.SchedInfo, req *computeapi.NetworkConfig, n *api.CandidateNetwork, netTypes []computeapi.TNetworkType, getFreePort func(string) int, ) core.PredicateFailureReason
func IsNetworksAvailable ¶
func IsNetworksAvailable(ctx context.Context, c core.Candidater, data *api.SchedInfo, req *computeapi.NetworkConfig, networks []*api.CandidateNetwork, netTypes []computeapi.TNetworkType, getFreePort func(string) int) (int, []core.PredicateFailureReason)
func NewCloudproviderSchedtagPredicate ¶
func NewCloudproviderSchedtagPredicate() core.FitPredicate
func NewCloudregionSchedtagPredicate ¶
func NewCloudregionSchedtagPredicate() core.FitPredicate
func NewHostSchedtagPredicate ¶
func NewHostSchedtagPredicate() core.FitPredicate
func NewZoneSchedtagPredicate ¶
func NewZoneSchedtagPredicate() core.FitPredicate
Types ¶
type BasePredicate ¶
type BasePredicate struct{}
BasePredicate is a default struct for all the predicates that will include it and implement it's Name() and PreExecute() methods.
func (*BasePredicate) GetHypervisorDriver ¶
func (b *BasePredicate) GetHypervisorDriver(u *core.Unit) models.IGuestDriver
func (*BasePredicate) Name ¶
func (b *BasePredicate) Name() string
func (*BasePredicate) PreExecute ¶
func (b *BasePredicate) PreExecute(ctx context.Context, unit *core.Unit, candis []core.Candidater) (bool, error)
type BaseSchedtagPredicate ¶
type BaseSchedtagPredicate struct { BasePredicate plugin.BasePlugin CandidateInputResources *CandidateInputResourcesMap Hypervisor string Provider string }
Schedtag Description require: Must be scheduled to the specified tag resource prefer: Priority to the specified resource avoid: Try to avoid scheduling to the specified resource exclude: Do not allow scheduling on the specified resource
func NewBaseSchedtagPredicate ¶
func NewBaseSchedtagPredicate() *BaseSchedtagPredicate
func (*BaseSchedtagPredicate) Execute ¶
func (p *BaseSchedtagPredicate) Execute( ctx context.Context, sp ISchedtagPredicateInstance, u *core.Unit, c core.Candidater, ) (bool, []core.PredicateFailureReason, error)
func (*BaseSchedtagPredicate) GetHypervisorDriver ¶
func (p *BaseSchedtagPredicate) GetHypervisorDriver() models.IGuestDriver
func (*BaseSchedtagPredicate) GetInputResourcesMap ¶
func (p *BaseSchedtagPredicate) GetInputResourcesMap(candidateId string) SchedtagInputResourcesMap
func (*BaseSchedtagPredicate) OnPriorityEnd ¶
func (p *BaseSchedtagPredicate) OnPriorityEnd(sp ISchedtagPredicateInstance, u *core.Unit, c core.Candidater)
func (*BaseSchedtagPredicate) OnSelectEnd ¶
func (p *BaseSchedtagPredicate) OnSelectEnd(sp ISchedtagPredicateInstance, u *core.Unit, c core.Candidater, count int64)
func (*BaseSchedtagPredicate) PreExecute ¶
func (p *BaseSchedtagPredicate) PreExecute(ctx context.Context, sp ISchedtagPredicateInstance, u *core.Unit, cs []core.Candidater) (bool, error)
type ClassMetadataPredicate ¶
type ClassMetadataPredicate struct { BasePredicate // contains filtered or unexported fields }
func (*ClassMetadataPredicate) Clone ¶
func (p *ClassMetadataPredicate) Clone() core.FitPredicate
func (*ClassMetadataPredicate) Execute ¶
func (p *ClassMetadataPredicate) Execute(ctx context.Context, u *core.Unit, c core.Candidater) (bool, []core.PredicateFailureReason, error)
func (*ClassMetadataPredicate) Name ¶
func (p *ClassMetadataPredicate) Name() string
func (*ClassMetadataPredicate) PreExecute ¶
func (p *ClassMetadataPredicate) PreExecute(ctx context.Context, u *core.Unit, cs []core.Candidater) (bool, error)
type CloudproviderSchedtagPredicate ¶
type CloudproviderSchedtagPredicate struct {
*ServerBaseSchedtagPredicate
}
func (*CloudproviderSchedtagPredicate) Clone ¶
func (p *CloudproviderSchedtagPredicate) Clone() core.FitPredicate
func (*CloudproviderSchedtagPredicate) GetCandidateResource ¶
func (p *CloudproviderSchedtagPredicate) GetCandidateResource(c core.Candidater) ISchedtagCandidateResource
func (*CloudproviderSchedtagPredicate) GetInputs ¶
func (p *CloudproviderSchedtagPredicate) GetInputs(u *core.Unit) []ISchedtagCustomer
func (*CloudproviderSchedtagPredicate) Name ¶
func (p *CloudproviderSchedtagPredicate) Name() string
func (*CloudproviderSchedtagPredicate) PreExecute ¶
func (p *CloudproviderSchedtagPredicate) PreExecute(ctx context.Context, u *core.Unit, cs []core.Candidater) (bool, error)
type CloudregionSchedtagPredicate ¶
type CloudregionSchedtagPredicate struct {
*ServerBaseSchedtagPredicate
}
func (*CloudregionSchedtagPredicate) Clone ¶
func (p *CloudregionSchedtagPredicate) Clone() core.FitPredicate
func (*CloudregionSchedtagPredicate) GetCandidateResource ¶
func (p *CloudregionSchedtagPredicate) GetCandidateResource(c core.Candidater) ISchedtagCandidateResource
func (*CloudregionSchedtagPredicate) GetInputs ¶
func (p *CloudregionSchedtagPredicate) GetInputs(u *core.Unit) []ISchedtagCustomer
func (*CloudregionSchedtagPredicate) Name ¶
func (p *CloudregionSchedtagPredicate) Name() string
type DiskSchedtagPredicate ¶
type DiskSchedtagPredicate struct { *BaseSchedtagPredicate // contains filtered or unexported fields }
func (*DiskSchedtagPredicate) AddSelectResult ¶
func (p *DiskSchedtagPredicate) AddSelectResult(index int, input ISchedtagCustomer, selectRes []ISchedtagCandidateResource, output *core.AllocatedResource)
func (*DiskSchedtagPredicate) Clone ¶
func (p *DiskSchedtagPredicate) Clone() core.FitPredicate
func (*DiskSchedtagPredicate) DoSelect ¶
func (p *DiskSchedtagPredicate) DoSelect( c core.Candidater, input ISchedtagCustomer, res []ISchedtagCandidateResource, ) []ISchedtagCandidateResource
func (*DiskSchedtagPredicate) Execute ¶
func (p *DiskSchedtagPredicate) Execute(ctx context.Context, u *core.Unit, c core.Candidater) (bool, []core.PredicateFailureReason, error)
func (*DiskSchedtagPredicate) GetCandidateResourceSortScore ¶
func (p *DiskSchedtagPredicate) GetCandidateResourceSortScore(selectRes ISchedtagCandidateResource) int64
func (*DiskSchedtagPredicate) GetInputs ¶
func (p *DiskSchedtagPredicate) GetInputs(u *core.Unit) []ISchedtagCustomer
func (*DiskSchedtagPredicate) GetResources ¶
func (p *DiskSchedtagPredicate) GetResources(c core.Candidater) []ISchedtagCandidateResource
func (*DiskSchedtagPredicate) GetUsedStorages ¶
func (p *DiskSchedtagPredicate) GetUsedStorages(res []ISchedtagCandidateResource, backend string) []ISchedtagCandidateResource
func (*DiskSchedtagPredicate) IsResourceFitInput ¶
func (p *DiskSchedtagPredicate) IsResourceFitInput(ctx context.Context, u *core.Unit, c core.Candidater, res ISchedtagCandidateResource, input ISchedtagCustomer) core.PredicateFailureReason
func (*DiskSchedtagPredicate) IsResourceMatchInput ¶
func (p *DiskSchedtagPredicate) IsResourceMatchInput(ctx context.Context, input ISchedtagCustomer, res ISchedtagCandidateResource) bool
func (*DiskSchedtagPredicate) Name ¶
func (p *DiskSchedtagPredicate) Name() string
func (*DiskSchedtagPredicate) OnPriorityEnd ¶
func (p *DiskSchedtagPredicate) OnPriorityEnd(u *core.Unit, c core.Candidater)
func (*DiskSchedtagPredicate) OnSelectEnd ¶
func (p *DiskSchedtagPredicate) OnSelectEnd(u *core.Unit, c core.Candidater, count int64)
func (*DiskSchedtagPredicate) PreExecute ¶
func (p *DiskSchedtagPredicate) PreExecute(ctx context.Context, u *core.Unit, cs []core.Candidater) (bool, error)
type DomainPredicate ¶
type DomainPredicate struct {
BasePredicate
}
func (*DomainPredicate) Clone ¶
func (p *DomainPredicate) Clone() core.FitPredicate
func (*DomainPredicate) Execute ¶
func (p *DomainPredicate) Execute(ctx context.Context, u *core.Unit, c core.Candidater) (bool, []core.PredicateFailureReason, error)
func (*DomainPredicate) Name ¶
func (p *DomainPredicate) Name() string
type FailReason ¶
func (FailReason) GetReason ¶
func (r FailReason) GetReason() string
func (FailReason) GetType ¶
func (r FailReason) GetType() string
type HostSchedtagPredicate ¶
type HostSchedtagPredicate struct {
*ServerBaseSchedtagPredicate
}
func (*HostSchedtagPredicate) Clone ¶
func (p *HostSchedtagPredicate) Clone() core.FitPredicate
func (*HostSchedtagPredicate) GetCandidateResource ¶
func (p *HostSchedtagPredicate) GetCandidateResource(c core.Candidater) ISchedtagCandidateResource
func (*HostSchedtagPredicate) GetInputs ¶
func (p *HostSchedtagPredicate) GetInputs(u *core.Unit) []ISchedtagCustomer
func (*HostSchedtagPredicate) Name ¶
func (p *HostSchedtagPredicate) Name() string
type INetworkNicCountGetter ¶
type ISchedtagCandidate ¶
type ISchedtagCustomer ¶
type ISchedtagPredicate ¶
type ISchedtagPredicate interface { GetExcludeTags() []computeapi.SchedtagConfig GetRequireTags() []computeapi.SchedtagConfig GetAvoidTags() []computeapi.SchedtagConfig GetPreferTags() []computeapi.SchedtagConfig }
type ISchedtagPredicateInstance ¶
type ISchedtagPredicateInstance interface { core.FitPredicate OnPriorityEnd(u *core.Unit, c core.Candidater) OnSelectEnd(u *core.Unit, c core.Candidater, count int64) GetInputs(u *core.Unit) []ISchedtagCustomer GetResources(c core.Candidater) []ISchedtagCandidateResource IsResourceMatchInput(ctx context.Context, input ISchedtagCustomer, res ISchedtagCandidateResource) bool IsResourceFitInput(ctx context.Context, unit *core.Unit, c core.Candidater, res ISchedtagCandidateResource, input ISchedtagCustomer) core.PredicateFailureReason DoSelect(c core.Candidater, input ISchedtagCustomer, res []ISchedtagCandidateResource) []ISchedtagCandidateResource AddSelectResult(index int, input ISchedtagCustomer, selectRes []ISchedtagCandidateResource, output *core.AllocatedResource) GetCandidateResourceSortScore(candidate ISchedtagCandidateResource) int64 }
type InstanceTypePredicate ¶
type InstanceTypePredicate struct {
BasePredicate
}
func (*InstanceTypePredicate) Clone ¶
func (p *InstanceTypePredicate) Clone() core.FitPredicate
func (*InstanceTypePredicate) Execute ¶
func (p *InstanceTypePredicate) Execute(ctx context.Context, u *core.Unit, c core.Candidater) (bool, []core.PredicateFailureReason, error)
func (*InstanceTypePredicate) Name ¶
func (p *InstanceTypePredicate) Name() string
func (*InstanceTypePredicate) PreExecute ¶
func (p *InstanceTypePredicate) PreExecute(ctx context.Context, u *core.Unit, cs []core.Candidater) (bool, error)
type InsufficientResourceError ¶
type InsufficientResourceError struct { // resourceName is the name of the resource that is insufficient ResourceName string // contains filtered or unexported fields }
InsufficientResourceError is an error type that indicates what kind of resource limit is hit and caused the unfitting failure.
func NewInsufficientResourceError ¶
func NewInsufficientResourceError(resourceName string, requested, total, free int64) *InsufficientResourceError
func (*InsufficientResourceError) Error ¶
func (ire *InsufficientResourceError) Error() string
func (*InsufficientResourceError) GetReason ¶
func (ire *InsufficientResourceError) GetReason() string
type IsolatedDevicePredicate ¶
type IsolatedDevicePredicate struct {
BasePredicate
}
IsolatedDevicePredicate check mode, and number of scheduled device configurations and current resources.
func (*IsolatedDevicePredicate) Clone ¶
func (f *IsolatedDevicePredicate) Clone() core.FitPredicate
func (*IsolatedDevicePredicate) Execute ¶
func (f *IsolatedDevicePredicate) Execute(ctx context.Context, u *core.Unit, c core.Candidater) (bool, []core.PredicateFailureReason, error)
func (*IsolatedDevicePredicate) Name ¶
func (f *IsolatedDevicePredicate) Name() string
func (*IsolatedDevicePredicate) PreExecute ¶
func (f *IsolatedDevicePredicate) PreExecute(ctx context.Context, u *core.Unit, cs []core.Candidater) (bool, error)
type NetworkPredicate ¶
type NetworkPredicate struct { BasePredicate plugin.BasePlugin NetworkNicCountGetter INetworkNicCountGetter // contains filtered or unexported fields }
NetworkPredicate will filter the current network information with the specified scheduling information to match, if not specified will randomly match the available network resources.
func NewNetworkPredicate ¶
func NewNetworkPredicate() *NetworkPredicate
func NewNetworkPredicateWithNicCounter ¶
func NewNetworkPredicateWithNicCounter() *NetworkPredicate
func (*NetworkPredicate) Clone ¶
func (p *NetworkPredicate) Clone() core.FitPredicate
func (*NetworkPredicate) Execute ¶
func (p *NetworkPredicate) Execute(ctx context.Context, u *core.Unit, c core.Candidater) (bool, []core.PredicateFailureReason, error)
func (*NetworkPredicate) GetNetworkTypes ¶
func (p *NetworkPredicate) GetNetworkTypes(u *core.Unit, specifyType computeapi.TNetworkType) []computeapi.TNetworkType
func (*NetworkPredicate) Name ¶
func (p *NetworkPredicate) Name() string
func (*NetworkPredicate) PreExecute ¶
func (p *NetworkPredicate) PreExecute(ctx context.Context, u *core.Unit, cs []core.Candidater) (bool, error)
func (*NetworkPredicate) WithNetworkCountGetter ¶
func (p *NetworkPredicate) WithNetworkCountGetter(getter INetworkNicCountGetter) *NetworkPredicate
type NetworkSchedtagPredicate ¶
type NetworkSchedtagPredicate struct {
*BaseSchedtagPredicate
}
func (*NetworkSchedtagPredicate) AddSelectResult ¶
func (p *NetworkSchedtagPredicate) AddSelectResult(index int, input ISchedtagCustomer, selectRes []ISchedtagCandidateResource, output *core.AllocatedResource)
func (*NetworkSchedtagPredicate) Clone ¶
func (p *NetworkSchedtagPredicate) Clone() core.FitPredicate
func (*NetworkSchedtagPredicate) DoSelect ¶
func (p *NetworkSchedtagPredicate) DoSelect( c core.Candidater, input ISchedtagCustomer, res []ISchedtagCandidateResource, ) []ISchedtagCandidateResource
func (*NetworkSchedtagPredicate) Execute ¶
func (p *NetworkSchedtagPredicate) Execute(ctx context.Context, u *core.Unit, c core.Candidater) (bool, []core.PredicateFailureReason, error)
func (*NetworkSchedtagPredicate) GetCandidateResourceSortScore ¶
func (p *NetworkSchedtagPredicate) GetCandidateResourceSortScore(selectRes ISchedtagCandidateResource) int64
func (*NetworkSchedtagPredicate) GetInputs ¶
func (p *NetworkSchedtagPredicate) GetInputs(u *core.Unit) []ISchedtagCustomer
func (*NetworkSchedtagPredicate) GetNetworkTypes ¶
func (p *NetworkSchedtagPredicate) GetNetworkTypes(specifyType computeapi.TNetworkType) []computeapi.TNetworkType
func (*NetworkSchedtagPredicate) GetResources ¶
func (p *NetworkSchedtagPredicate) GetResources(c core.Candidater) []ISchedtagCandidateResource
func (*NetworkSchedtagPredicate) IsResourceFitInput ¶
func (p *NetworkSchedtagPredicate) IsResourceFitInput(ctx context.Context, u *core.Unit, c core.Candidater, res ISchedtagCandidateResource, input ISchedtagCustomer) core.PredicateFailureReason
func (*NetworkSchedtagPredicate) IsResourceMatchInput ¶
func (p *NetworkSchedtagPredicate) IsResourceMatchInput(ctx context.Context, input ISchedtagCustomer, res ISchedtagCandidateResource) bool
func (*NetworkSchedtagPredicate) Name ¶
func (p *NetworkSchedtagPredicate) Name() string
func (*NetworkSchedtagPredicate) OnPriorityEnd ¶
func (p *NetworkSchedtagPredicate) OnPriorityEnd(u *core.Unit, c core.Candidater)
func (*NetworkSchedtagPredicate) OnSelectEnd ¶
func (p *NetworkSchedtagPredicate) OnSelectEnd(u *core.Unit, c core.Candidater, count int64)
func (*NetworkSchedtagPredicate) PreExecute ¶
func (p *NetworkSchedtagPredicate) PreExecute(ctx context.Context, u *core.Unit, cs []core.Candidater) (bool, error)
type PredicateHelper ¶
type PredicateHelper struct { Unit *core.Unit Candidate core.Candidater // contains filtered or unexported fields }
func NewPredicateHelper ¶
func NewPredicateHelper(pre core.FitPredicate, unit *core.Unit, candi core.Candidater) *PredicateHelper
func (*PredicateHelper) AppendInsufficientResourceError ¶
func (h *PredicateHelper) AppendInsufficientResourceError(req, total, free int64)
func (*PredicateHelper) AppendPredicateFail ¶
func (h *PredicateHelper) AppendPredicateFail(reason core.PredicateFailureReason)
func (*PredicateHelper) AppendPredicateFailMsg ¶
func (h *PredicateHelper) AppendPredicateFailMsg(reason string)
func (*PredicateHelper) AppendPredicateFailMsgWithType ¶
func (h *PredicateHelper) AppendPredicateFailMsgWithType(reason string, eType string)
func (*PredicateHelper) Exclude ¶
func (h *PredicateHelper) Exclude(reason string)
func (*PredicateHelper) Exclude2 ¶
func (h *PredicateHelper) Exclude2(predicateName string, current, expected interface{})
func (*PredicateHelper) ExcludeByErrors ¶
func (h *PredicateHelper) ExcludeByErrors(errs []core.PredicateFailureReason)
func (*PredicateHelper) GetFailedResult ¶
func (h *PredicateHelper) GetFailedResult(err error) (bool, []core.PredicateFailureReason, error)
func (*PredicateHelper) GetResult ¶
func (h *PredicateHelper) GetResult() (bool, []core.PredicateFailureReason, error)
func (*PredicateHelper) SetCapacity ¶
func (h *PredicateHelper) SetCapacity(capacity int64)
SetCapacity returns the current resource capacity calculated by a filter. And 'capacity' default is -1.
func (*PredicateHelper) SetCapacityCounter ¶
func (h *PredicateHelper) SetCapacityCounter(counter core.Counter)
func (*PredicateHelper) SetSelectPriority ¶
func (h *PredicateHelper) SetSelectPriority(sp int)
func (*PredicateHelper) UseReserved ¶
func (h *PredicateHelper) UseReserved() bool
UseReserved check whether the unit can use guest reserved resource
type PredicatedSchedtagResource ¶
type PredicatedSchedtagResource struct { ISchedtagCandidateResource PreferTags []computeapi.SchedtagConfig AvoidTags []computeapi.SchedtagConfig }
type ResourceTypePredicate ¶
type ResourceTypePredicate struct {
BasePredicate
}
func (*ResourceTypePredicate) Clone ¶
func (p *ResourceTypePredicate) Clone() core.FitPredicate
func (*ResourceTypePredicate) Execute ¶
func (p *ResourceTypePredicate) Execute(ctx context.Context, u *core.Unit, c core.Candidater) (bool, []core.PredicateFailureReason, error)
func (*ResourceTypePredicate) Name ¶
func (p *ResourceTypePredicate) Name() string
func (*ResourceTypePredicate) PreExecute ¶
func (p *ResourceTypePredicate) PreExecute(ctx context.Context, u *core.Unit, cs []core.Candidater) (bool, error)
type ResourceWithClassMetadata ¶
type ResourceWithClassMetadata struct {
// contains filtered or unexported fields
}
func (*ResourceWithClassMetadata) GetAllClassMetadata ¶
func (rcm *ResourceWithClassMetadata) GetAllClassMetadata() (map[string]string, error)
func (*ResourceWithClassMetadata) GetDescription ¶
func (rcm *ResourceWithClassMetadata) GetDescription() string
type SQuotaPredicate ¶
type SQuotaPredicate struct {
BasePredicate
}
func (*SQuotaPredicate) Clone ¶
func (p *SQuotaPredicate) Clone() core.FitPredicate
func (*SQuotaPredicate) Execute ¶
func (p *SQuotaPredicate) Execute(ctx context.Context, u *core.Unit, c core.Candidater) (bool, []core.PredicateFailureReason, error)
func (*SQuotaPredicate) Name ¶
func (p *SQuotaPredicate) Name() string
func (*SQuotaPredicate) PreExecute ¶
func (p *SQuotaPredicate) PreExecute(ctx context.Context, u *core.Unit, cs []core.Candidater) (bool, error)
type SchedtagChecker ¶
type SchedtagChecker struct { }
func (*SchedtagChecker) Check ¶
func (c *SchedtagChecker) Check(p ISchedtagPredicate, candidate ISchedtagCandidate) error
func (*SchedtagChecker) Contains ¶
func (c *SchedtagChecker) Contains(objectTags []schedtag.ISchedtag, tags []computeapi.SchedtagConfig) (bool, *computeapi.SchedtagConfig)
func (*SchedtagChecker) GetCandidateSchedtags ¶
func (c *SchedtagChecker) GetCandidateSchedtags(candidate ISchedtagCandidate) ([]schedtag.ISchedtag, error)
func (*SchedtagChecker) HasIntersection ¶
func (c *SchedtagChecker) HasIntersection(tags []computeapi.SchedtagConfig, objTags []schedtag.ISchedtag) (bool, schedtag.ISchedtag)
type SchedtagInputResourcesMap ¶
type SchedtagInputResourcesMap map[int][]*PredicatedSchedtagResource
func (SchedtagInputResourcesMap) GetAvoidTags ¶
func (m SchedtagInputResourcesMap) GetAvoidTags() []computeapi.SchedtagConfig
func (SchedtagInputResourcesMap) GetPreferTags ¶
func (m SchedtagInputResourcesMap) GetPreferTags() []computeapi.SchedtagConfig
type SchedtagPredicate ¶
type SchedtagPredicate struct {
// contains filtered or unexported fields
}
func NewSchedtagPredicate ¶
func NewSchedtagPredicate(reqTags []*computeapi.SchedtagConfig, allTags []schedtag.ISchedtag) *SchedtagPredicate
func (*SchedtagPredicate) Check ¶
func (p *SchedtagPredicate) Check(candidate ISchedtagCandidate) error
func (*SchedtagPredicate) GetAvoidTags ¶
func (p *SchedtagPredicate) GetAvoidTags() []computeapi.SchedtagConfig
func (*SchedtagPredicate) GetExcludeTags ¶
func (p *SchedtagPredicate) GetExcludeTags() []computeapi.SchedtagConfig
func (*SchedtagPredicate) GetPreferTags ¶
func (p *SchedtagPredicate) GetPreferTags() []computeapi.SchedtagConfig
func (*SchedtagPredicate) GetRequireTags ¶
func (p *SchedtagPredicate) GetRequireTags() []computeapi.SchedtagConfig
type SchedtagResourceW ¶
type SchedtagResourceW struct {
// contains filtered or unexported fields
}
func (SchedtagResourceW) GetDynamicSchedDesc ¶
func (w SchedtagResourceW) GetDynamicSchedDesc() *jsonutils.JSONDict
func (SchedtagResourceW) GetId ¶
func (w SchedtagResourceW) GetId() string
func (SchedtagResourceW) GetSchedtags ¶
func (w SchedtagResourceW) GetSchedtags() []schedtag.ISchedtag
func (SchedtagResourceW) IndexKey ¶
func (w SchedtagResourceW) IndexKey() string
func (SchedtagResourceW) ResourceType ¶
func (w SchedtagResourceW) ResourceType() string
type ServerBaseSchedtagPredicate ¶
type ServerBaseSchedtagPredicate struct { *BaseSchedtagPredicate // contains filtered or unexported fields }
func NewServerBaseSchedtagPredicate ¶
func NewServerBaseSchedtagPredicate(filter iServerBaseSchedtagPredicate) *ServerBaseSchedtagPredicate
func (*ServerBaseSchedtagPredicate) AddSelectResult ¶
func (p *ServerBaseSchedtagPredicate) AddSelectResult(index int, input ISchedtagCustomer, selectRes []ISchedtagCandidateResource, output *core.AllocatedResource)
func (*ServerBaseSchedtagPredicate) DoSelect ¶
func (p *ServerBaseSchedtagPredicate) DoSelect( c core.Candidater, input ISchedtagCustomer, res []ISchedtagCandidateResource, ) []ISchedtagCandidateResource
func (*ServerBaseSchedtagPredicate) Execute ¶
func (p *ServerBaseSchedtagPredicate) Execute(ctx context.Context, u *core.Unit, c core.Candidater) (bool, []core.PredicateFailureReason, error)
func (*ServerBaseSchedtagPredicate) GetCandidateResourceSortScore ¶
func (p *ServerBaseSchedtagPredicate) GetCandidateResourceSortScore(selectRes ISchedtagCandidateResource) int64
func (*ServerBaseSchedtagPredicate) GetResources ¶
func (p *ServerBaseSchedtagPredicate) GetResources(c core.Candidater) []ISchedtagCandidateResource
func (*ServerBaseSchedtagPredicate) IsResourceFitInput ¶
func (p *ServerBaseSchedtagPredicate) IsResourceFitInput(ctx context.Context, u *core.Unit, c core.Candidater, res ISchedtagCandidateResource, input ISchedtagCustomer) core.PredicateFailureReason
func (*ServerBaseSchedtagPredicate) IsResourceMatchInput ¶
func (p *ServerBaseSchedtagPredicate) IsResourceMatchInput(ctx context.Context, input ISchedtagCustomer, res ISchedtagCandidateResource) bool
func (*ServerBaseSchedtagPredicate) OnPriorityEnd ¶
func (p *ServerBaseSchedtagPredicate) OnPriorityEnd(u *core.Unit, c core.Candidater)
func (*ServerBaseSchedtagPredicate) OnSelectEnd ¶
func (p *ServerBaseSchedtagPredicate) OnSelectEnd(u *core.Unit, c core.Candidater, count int64)
func (*ServerBaseSchedtagPredicate) PreExecute ¶
func (p *ServerBaseSchedtagPredicate) PreExecute(ctx context.Context, u *core.Unit, cs []core.Candidater) (bool, error)
type SortNetworks ¶
type SortNetworks struct {
// contains filtered or unexported fields
}
func (*SortNetworks) Len ¶
func (ns *SortNetworks) Len() int
func (*SortNetworks) Less ¶
func (ns *SortNetworks) Less(i, j int) bool
func (*SortNetworks) Results ¶
func (ns *SortNetworks) Results() []ISchedtagCandidateResource
func (*SortNetworks) Swap ¶
func (ns *SortNetworks) Swap(i, j int)
type UnexceptedResourceError ¶
type UnexceptedResourceError struct {
// contains filtered or unexported fields
}
func Error ¶
func Error(message string) *UnexceptedResourceError
func NewUnexceptedResourceError ¶
func NewUnexceptedResourceError(message string) *UnexceptedResourceError
func (*UnexceptedResourceError) Error ¶
func (ure *UnexceptedResourceError) Error() string
func (*UnexceptedResourceError) GetReason ¶
func (ure *UnexceptedResourceError) GetReason() string
type ZoneSchedtagPredicate ¶
type ZoneSchedtagPredicate struct {
*ServerBaseSchedtagPredicate
}
func (*ZoneSchedtagPredicate) Clone ¶
func (p *ZoneSchedtagPredicate) Clone() core.FitPredicate
func (*ZoneSchedtagPredicate) GetCandidateResource ¶
func (p *ZoneSchedtagPredicate) GetCandidateResource(c core.Candidater) ISchedtagCandidateResource
func (*ZoneSchedtagPredicate) GetInputs ¶
func (p *ZoneSchedtagPredicate) GetInputs(u *core.Unit) []ISchedtagCustomer
func (*ZoneSchedtagPredicate) Name ¶
func (p *ZoneSchedtagPredicate) Name() string
Source Files ¶
- class_metadata_predicate.go
- cloudprovider_schedtag_predicate.go
- cloudregion_schedtag_predicate.go
- disk_schedtag_predicate.go
- doc.go
- domain_predicate.go
- error.go
- host_schedtag_predicate.go
- isolated_device_predicate.go
- network_predicate.go
- network_schedtag_predicate.go
- predicates.go
- quota_predicate.go
- resource_type_predicate.go
- schedtag_helper.go
- sku_predicate.go
- zone_schedtag_predicate.go