mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
update
This commit is contained in:
@@ -116,7 +116,7 @@ func (p *DiskSchedtagPredicate) DoSelect(
|
||||
return p.GetUsedStorages(res, input.(*diskW).Backend)
|
||||
}
|
||||
|
||||
func (p *DiskSchedtagPredicate) GetCandidateResourceSortScore(selectRes ISchedtagCandidateResource) int {
|
||||
func (p *DiskSchedtagPredicate) GetCandidateResourceSortScore(selectRes ISchedtagCandidateResource) int64 {
|
||||
return selectRes.(*api.CandidateStorage).GetFreeCapacity()
|
||||
}
|
||||
|
||||
|
||||
@@ -143,12 +143,12 @@ func (p *NetworkSchedtagPredicate) OnSelectEnd(u *core.Unit, c core.Candidater,
|
||||
p.BaseSchedtagPredicate.OnSelectEnd(p, u, c, count)
|
||||
}
|
||||
|
||||
func (p *NetworkSchedtagPredicate) GetCandidateResourceSortScore(selectRes ISchedtagCandidateResource) int {
|
||||
func (p *NetworkSchedtagPredicate) GetCandidateResourceSortScore(selectRes ISchedtagCandidateResource) int64 {
|
||||
cnt, err := selectRes.(*api.CandidateNetwork).GetFreeAddressCount()
|
||||
if err != nil {
|
||||
return -1
|
||||
}
|
||||
return cnt
|
||||
return int64(cnt)
|
||||
}
|
||||
|
||||
func (p *NetworkSchedtagPredicate) DoSelect(
|
||||
|
||||
@@ -241,7 +241,7 @@ type ISchedtagPredicateInstance interface {
|
||||
|
||||
DoSelect(c core.Candidater, input ISchedtagCustomer, res []ISchedtagCandidateResource) []ISchedtagCandidateResource
|
||||
AddSelectResult(index int, selectRes []ISchedtagCandidateResource, output *core.AllocatedResource)
|
||||
GetCandidateResourceSortScore(candidate ISchedtagCandidateResource) int
|
||||
GetCandidateResourceSortScore(candidate ISchedtagCandidateResource) int64
|
||||
}
|
||||
|
||||
type BaseSchedtagPredicate struct {
|
||||
|
||||
Reference in New Issue
Block a user