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