Exemplo n.º 1
0
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
}
Exemplo n.º 2
0
// 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()]
}
Exemplo n.º 3
0
// 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)
}
Exemplo n.º 4
0
func (s *Scheduler) OfferRescinded(driver scheduler.SchedulerDriver, id *mesos.OfferID) {
	Logger.Infof("[OfferRescinded] %s", id.GetValue())
}
Exemplo n.º 5
0
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
}
Exemplo n.º 6
0
func (sched *Scheduler) OfferRescinded(driver sched.SchedulerDriver, offerID *mesos.OfferID) {
	glog.Infof("offer %s has been recinded before we could use it", offerID.GetValue())
}
Exemplo n.º 7
0
func (cache *schedCache) removeOffer(offerId *mesos.OfferID) {
	cache.lock.Lock()
	delete(cache.savedOffers, offerId.GetValue())
	cache.lock.Unlock()
}
Exemplo n.º 8
0
// 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
}