當前位置: 首頁>>代碼示例>>Golang>>正文


Golang mesosproto.OfferID類代碼示例

本文整理匯總了Golang中github.com/mesos/mesos-go/mesosproto.OfferID的典型用法代碼示例。如果您正苦於以下問題:Golang OfferID類的具體用法?Golang OfferID怎麽用?Golang OfferID使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了OfferID類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: Rescind

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
}
開發者ID:puppetizeme,項目名稱:etcd-mesos,代碼行數:7,代碼來源:offercache.go

示例2: getOffer

// 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()]
}
開發者ID:40a,項目名稱:bootkube,代碼行數:10,代碼來源:schedcache.go

示例3: OfferRescinded

// 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)
}
開發者ID:niu-team,項目名稱:kubernetes,代碼行數:7,代碼來源:scheduler.go

示例4: OfferRescinded

func (s *Scheduler) OfferRescinded(driver scheduler.SchedulerDriver, id *mesos.OfferID) {
	Logger.Infof("[OfferRescinded] %s", id.GetValue())
}
開發者ID:elodina,項目名稱:syscol,代碼行數:3,代碼來源:scheduler.go

示例5: OfferRescinded

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
}
開發者ID:elodina,項目名稱:stack-deploy,代碼行數:6,代碼來源:scheduler_intgr_test.go

示例6: OfferRescinded

func (sched *Scheduler) OfferRescinded(driver sched.SchedulerDriver, offerID *mesos.OfferID) {
	glog.Infof("offer %s has been recinded before we could use it", offerID.GetValue())
}
開發者ID:betawaffle,項目名稱:elevators,代碼行數:3,代碼來源:scheduler.go

示例7: removeOffer

func (cache *schedCache) removeOffer(offerId *mesos.OfferID) {
	cache.lock.Lock()
	delete(cache.savedOffers, offerId.GetValue())
	cache.lock.Unlock()
}
開發者ID:40a,項目名稱:bootkube,代碼行數:5,代碼來源:schedcache.go

示例8: containsOffer

// 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
}
開發者ID:40a,項目名稱:bootkube,代碼行數:7,代碼來源:schedcache.go


注:本文中的github.com/mesos/mesos-go/mesosproto.OfferID類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。