本文整理匯總了Golang中github.com/mesos/mesos-go/mesosproto.SlaveID.GetValue方法的典型用法代碼示例。如果您正苦於以下問題:Golang SlaveID.GetValue方法的具體用法?Golang SlaveID.GetValue怎麽用?Golang SlaveID.GetValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/mesos/mesos-go/mesosproto.SlaveID
的用法示例。
在下文中一共展示了SlaveID.GetValue方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: getSlavePid
func (cache *schedCache) getSlavePid(slaveId *mesos.SlaveID) *upid.UPID {
if slaveId == nil {
log.V(3).Infoln("SlaveId == nil, returning empty UPID")
return nil
}
return cache.savedSlavePids[slaveId.GetValue()]
}
示例2: FrameworkMessage
func (sched *testScheduler) FrameworkMessage(dr SchedulerDriver, execId *mesos.ExecutorID, slaveId *mesos.SlaveID, data string) {
log.Infoln("Sched.FrameworkMessage() called.")
sched.s.NotNil(slaveId)
sched.s.Equal(slaveId.GetValue(), "test-slave-001")
sched.s.NotNil(execId)
sched.s.NotNil(data)
sched.s.Equal("test-data-999", string(data))
sched.ch <- true
}
示例3: SlaveLost
// SlaveLost is called when some slave is lost.
func (k *KubernetesScheduler) SlaveLost(driver bindings.SchedulerDriver, slaveId *mesos.SlaveID) {
log.Infof("Slave %v is lost\n", slaveId)
sid := slaveId.GetValue()
k.offers.InvalidateForSlave(sid)
// TODO(jdef): delete slave from our internal list? probably not since we may need to reconcile
// tasks. it would be nice to somehow flag the slave as lost so that, perhaps, we can periodically
// flush lost slaves older than X, and for which no tasks or pods reference.
// unfinished tasks/pods will be dropped. use a replication controller if you want pods to
// be restarted when slaves die.
}
示例4: SlaveLost
func (s *Scheduler) SlaveLost(driver scheduler.SchedulerDriver, slave *mesos.SlaveID) {
Logger.Infof("[SlaveLost] %s", slave.GetValue())
}
示例5: SlaveLost
func (sched *testScheduler) SlaveLost(dr SchedulerDriver, slaveId *mesos.SlaveID) {
log.Infoln("Sched.SlaveLost() called.")
sched.s.NotNil(slaveId)
sched.s.Equal(slaveId.GetValue(), "test-slave-001")
sched.ch <- true
}
示例6: ExecutorLost
func (sched *Scheduler) ExecutorLost(driver sched.SchedulerDriver, executorID *mesos.ExecutorID, slaveID *mesos.SlaveID, status int) {
glog.Errorf("lost executor %s on slave %s with status %d", executorID.GetValue(), slaveID.GetValue(), status)
}
示例7: SlaveLost
func (sched *Scheduler) SlaveLost(driver sched.SchedulerDriver, slaveID *mesos.SlaveID) {
glog.Errorf("lost slave %s", slaveID.GetValue())
}
示例8: FrameworkMessage
func (sched *Scheduler) FrameworkMessage(driver sched.SchedulerDriver, executorID *mesos.ExecutorID, slaveID *mesos.SlaveID, data string) {
glog.Errorf("got framework message from executor %s on slave %s: %q", executorID.GetValue(), slaveID.GetValue(), data)
}
示例9: removeSlavePid
func (cache *schedCache) removeSlavePid(slaveId *mesos.SlaveID) {
cache.lock.Lock()
delete(cache.savedSlavePids, slaveId.GetValue())
cache.lock.Unlock()
}
示例10: containsSlavePid
func (cache *schedCache) containsSlavePid(slaveId *mesos.SlaveID) bool {
cache.lock.RLock()
defer cache.lock.RUnlock()
_, ok := cache.savedSlavePids[slaveId.GetValue()]
return ok
}
示例11: putSlavePid
func (cache *schedCache) putSlavePid(slaveId *mesos.SlaveID, pid *upid.UPID) {
cache.lock.Lock()
cache.savedSlavePids[slaveId.GetValue()] = pid
cache.lock.Unlock()
}