예제 #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
}
예제 #2
0
파일: schedcache.go 프로젝트: 40a/bootkube
// 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()]
}
예제 #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)
}
예제 #4
0
파일: scheduler.go 프로젝트: elodina/syscol
func (s *Scheduler) OfferRescinded(driver scheduler.SchedulerDriver, id *mesos.OfferID) {
	Logger.Infof("[OfferRescinded] %s", id.GetValue())
}
예제 #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
}
예제 #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())
}
예제 #7
0
파일: schedcache.go 프로젝트: 40a/bootkube
func (cache *schedCache) removeOffer(offerId *mesos.OfferID) {
	cache.lock.Lock()
	delete(cache.savedOffers, offerId.GetValue())
	cache.lock.Unlock()
}
예제 #8
0
파일: schedcache.go 프로젝트: 40a/bootkube
// 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
}