Retrofitted all schedulers to now pick the hostname from the offer and add it to constants.Hosts

This commit is contained in:
Abhishek Jain 2017-03-23 22:16:05 -04:00
parent f85ed944f4
commit aed4fd1073
14 changed files with 70 additions and 6 deletions

View file

@ -261,6 +261,10 @@ func (s *BPSWMaxMinPistonCapping) ResourceOffers(driver sched.SchedulerDriver, o
log.Printf("Received %d resource offers", len(offers))
for _, offer := range offers {
if _, ok := constants.Hosts[offer.GetHostname()]; !ok {
log.Printf("New host found. Adding host [%s]", offer.GetHostname())
constants.Hosts[offer.GetHostname()] = struct{}{}
}
select {
case <-s.Shutdown:
log.Println("Done scheduling tasks: declining offer on [", offer.GetHostname(), "]")