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