本文整理汇总了Golang中github.com/mesos/mesos-go/mesosproto.OfferID.GetValue方法的典型用法代码示例。如果您正苦于以下问题:Golang OfferID.GetValue方法的具体用法?Golang OfferID.GetValue怎么用?Golang OfferID.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/mesos/mesos-go/mesosproto.OfferID
的用法示例。
在下文中一共展示了OfferID.GetValue方法的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
}
示例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()]
}
示例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)
}
示例4: OfferRescinded
func (s *Scheduler) OfferRescinded(driver scheduler.SchedulerDriver, id *mesos.OfferID) {
Logger.Infof("[OfferRescinded] %s", id.GetValue())
}
示例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
}
示例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())
}
示例7: removeOffer
func (cache *schedCache) removeOffer(offerId *mesos.OfferID) {
cache.lock.Lock()
delete(cache.savedOffers, offerId.GetValue())
cache.lock.Unlock()
}
示例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
}