Added a HostMismatch(...) in offerUtils that checks whether a task's host requirement matches the host corresponding to the offer. Made sure all schedulers call takeOffer(...) that is defined in each scheduler, to maintain consistency.
This commit is contained in:
parent
aabdd716dd
commit
6c62b5326f
20 changed files with 175 additions and 239 deletions
|
@ -15,7 +15,6 @@ import (
|
|||
"log"
|
||||
"math"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
@ -258,13 +257,8 @@ func (s *BinPackedPistonCapper) ResourceOffers(driver sched.SchedulerDriver, off
|
|||
partialLoad := 0.0
|
||||
for i := 0; i < len(s.tasks); i++ {
|
||||
task := s.tasks[i]
|
||||
// Check host if it exists
|
||||
if task.Host != "" {
|
||||
// Don't take offer if it doens't match our task's host requirement.
|
||||
if !strings.HasPrefix(*offer.Hostname, task.Host) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
// Don't take offer if it doesn't match our task's host requirement
|
||||
if offerUtils.HostMismatch(*offer.Hostname, task.Host) {continue}
|
||||
|
||||
for *task.Instances > 0 {
|
||||
// Does the task fit
|
||||
|
|
Reference in a new issue