示例#1
0
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
0
func (cache *schedCache) removeSlavePid(slaveId *mesos.SlaveID) {
	cache.lock.Lock()
	delete(cache.savedSlavePids, slaveId.GetValue())
	cache.lock.Unlock()
}
示例#3
0
func (cache *schedCache) containsSlavePid(slaveId *mesos.SlaveID) bool {
	cache.lock.RLock()
	defer cache.lock.RUnlock()
	_, ok := cache.savedSlavePids[slaveId.GetValue()]
	return ok
}
示例#4
0
func (cache *schedCache) putSlavePid(slaveId *mesos.SlaveID, pid *upid.UPID) {
	cache.lock.Lock()
	cache.savedSlavePids[slaveId.GetValue()] = pid
	cache.lock.Unlock()
}