func (oc *OfferCache) Rescind(offerId *mesos.OfferID) bool { oc.mut.Lock() defer oc.mut.Unlock() _, present := oc.offerSet[offerId.GetValue()] delete(oc.offerSet, offerId.GetValue()) return present }
// getOffer returns cached offer func (cache *schedCache) getOffer(offerId *mesos.OfferID) *cachedOffer { if offerId == nil { log.V(3).Infoln("WARN: OfferId == nil, returning nil") return nil } cache.lock.RLock() defer cache.lock.RUnlock() return cache.savedOffers[offerId.GetValue()] }
// OfferRescinded is called when the resources are recinded from the scheduler. func (k *KubernetesScheduler) OfferRescinded(driver bindings.SchedulerDriver, offerId *mesos.OfferID) { log.Infof("Offer rescinded %v\n", offerId) oid := offerId.GetValue() k.offers.Delete(oid, offerMetrics.OfferRescinded) }
func (s *Scheduler) OfferRescinded(driver scheduler.SchedulerDriver, id *mesos.OfferID) { Logger.Infof("[OfferRescinded] %s", id.GetValue()) }
func (sched *testScheduler) OfferRescinded(dr SchedulerDriver, oid *mesos.OfferID) { log.Infoln("Sched.OfferRescinded() called.") sched.s.NotNil(oid) sched.s.Equal("test-offer-001", oid.GetValue()) sched.ch <- true }
func (sched *Scheduler) OfferRescinded(driver sched.SchedulerDriver, offerID *mesos.OfferID) { glog.Infof("offer %s has been recinded before we could use it", offerID.GetValue()) }
func (cache *schedCache) removeOffer(offerId *mesos.OfferID) { cache.lock.Lock() delete(cache.savedOffers, offerId.GetValue()) cache.lock.Unlock() }
// containsOff test cache for offer(offerId) func (cache *schedCache) containsOffer(offerId *mesos.OfferID) bool { cache.lock.RLock() defer cache.lock.RUnlock() _, ok := cache.savedOffers[offerId.GetValue()] return ok }