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


Golang mesosproto.SlaveID類代碼示例

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


在下文中一共展示了SlaveID類的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()]
}
開發者ID:40a,項目名稱:bootkube,代碼行數:7,代碼來源:schedcache.go

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

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

示例4: SlaveLost

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

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

示例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)
}
開發者ID:betawaffle,項目名稱:elevators,代碼行數:3,代碼來源:scheduler.go

示例7: SlaveLost

func (sched *Scheduler) SlaveLost(driver sched.SchedulerDriver, slaveID *mesos.SlaveID) {
	glog.Errorf("lost slave %s", slaveID.GetValue())
}
開發者ID:betawaffle,項目名稱:elevators,代碼行數:3,代碼來源:scheduler.go

示例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)
}
開發者ID:betawaffle,項目名稱:elevators,代碼行數:3,代碼來源:scheduler.go

示例9: removeSlavePid

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

示例10: containsSlavePid

func (cache *schedCache) containsSlavePid(slaveId *mesos.SlaveID) bool {
	cache.lock.RLock()
	defer cache.lock.RUnlock()
	_, ok := cache.savedSlavePids[slaveId.GetValue()]
	return ok
}
開發者ID:40a,項目名稱:bootkube,代碼行數:6,代碼來源:schedcache.go

示例11: putSlavePid

func (cache *schedCache) putSlavePid(slaveId *mesos.SlaveID, pid *upid.UPID) {
	cache.lock.Lock()
	cache.savedSlavePids[slaveId.GetValue()] = pid
	cache.lock.Unlock()
}
開發者ID:40a,項目名稱:bootkube,代碼行數:5,代碼來源:schedcache.go


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