Retrofitted all the schedulers to now call the offerutils.AddHostIfNew(..) utility function which will dynamically populate the constants.Hosts and constants.PowerClasses.
This commit is contained in:
parent
841c7d5ee8
commit
b4f9a989cb
16 changed files with 37 additions and 75 deletions
|
@ -246,10 +246,7 @@ func (s *FirstFitSortedWattsProacCC) ResourceOffers(driver sched.SchedulerDriver
|
|||
|
||||
// retrieving the available power for all the hosts in the 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{}{}
|
||||
}
|
||||
offerUtils.AddHostIfNew(offer)
|
||||
_, _, offer_watts := offerUtils.OfferAgg(offer)
|
||||
s.availablePower[*offer.Hostname] = offer_watts
|
||||
// setting total power if the first time.
|
||||
|
|
Reference in a new issue