This commit is contained in:
ioito
2019-05-21 21:29:05 +08:00
parent e878330938
commit d2c9c7d740
97 changed files with 2810 additions and 526 deletions
@@ -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 {