// Get returns the []byte representation of a cached response and a bool set
// to true if the key was found.  It tries the first tier cache, and if
// that's not successful, copies the result from the second tier into the
// first tier.
424426
func (c *TwoTier) Get(key string) ([]byte, bool) {
	if value, ok := c.first.Get(key); ok {
		return value, true
	}

	value, ok := c.second.Get(key)
	if !ok {
		return nil, false
	}

	c.first.Set(key, value)

	return value, true
}
118771
func (hm *SyncedHashMap) Get(key Hashable) (interface{}, bool) {
	hm.RLock()
	defer hm.RUnlock()
	if _, ok := (*hm).keys[key.Hash()]; ok {
		v, ok := (*hm).values[key.Hash()]
		return v, ok
	}
	return nil, false
}
39049
func (c *Cache) Get(key string) (value interface{}, ok bool) {
	if !c.nolock {
		c.mu.Lock()
		defer c.mu.Unlock()
	}
	if ele, hit := c.cache[key]; hit {
		c.ll.MoveToFront(ele)
		return ele.Value.(*entry).value, true
	}
	return
}
65561
func (r *MemoryTTL) Get(key string) (interface{}, error) {
	r.RLock()

	for !r.isValid(key) {
		r.RUnlock()
		// Need write lock to delete key, so need to unlock, relock and recheck
		r.Lock()
		if !r.isValid(key) {
			r.delete(key)
			r.Unlock()
			return nil, ErrNotFound
		}
		r.Unlock()
		// Could become invalid again in this window
		r.RLock()
	}

	defer r.RUnlock()

	value, err := r.cache.Get(key)
	if err != nil {
		return nil, err
	}

	return value, nil
}
612440
func (c *NodbCacher) Get(key string) interface{} {
	val, err := c.db.Get([]byte(key))
	if err != nil {
		return nil
	}
	if len(val) > 0 {
		return string(val)
	}
	return nil
}
1049167
func (c *RedisCache) Get(key string, data interface{}) bool {
	b, ok := c.GetGobBytes(key)
	if !ok {
		return false
	}

	dec := gob.NewDecoder(bytes.NewBuffer(b))
	dec.Decode(data)
	return true
}
314410
func (c *Cache) Get(u interface{}) (i interface{}, err error) {

	c.Lock()
	defer c.Unlock()

	if _, ok := c.data[u]; !ok {
		return nil, errors.New("not found")
	}

	return c.data[u].value, nil
}
570254
func (s *CacheOnStorage) Get(key interface{}) (interface{}, error) {
	if item, err := s.cache.Get(key); err != nil {
		return nil, err
	} else if item != nil {
		return item, nil
	}

	item, err := s.storage.Get(key)
	if err != nil {
		return nil, err
	}

	if err := s.cache.Set(item); err != nil {
		// XXX: Maybe make this a non error
		return nil, err
	}
	return item, nil
}
1102539
func (c *randomEvictedCache) Get(key Measurable) (data Measurable, ok bool) {
	c.mu.RLock()
	defer c.mu.RUnlock()
	memoized, ok := c.data[key]
	if !ok {
		return nil, false
	}
	return memoized.m, ok
}
1284259
func (t *TSCache) Get(key string) (time.Time, bool) {
	t.mux.RLock()
	defer t.mux.RUnlock()
	ts, ok := t.table[key]
	return ts, ok
}
1061950
func (c *RawBinaryClient) Get(key string) GetResponse {
	c.mutex.Lock()
	defer c.mutex.Unlock()

	if resp := c.sendGetRequest(key); resp != nil {
		return resp
	}

	return c.receiveGetResponse(key)
}
442221
func (c *BigCache) Get(key string) ([]byte, error) {
	hashedKey := c.hash.Sum64(key)
	shard := c.getShard(hashedKey)
	return shard.get(key, hashedKey)
}
1217787
func Get() (p []byte, err error) {
	var l load.LoadAvg
	err = l.Get()
	if err != nil {
		return nil, err
	}
	return json.Marshal(&l)
}
446393
func (c *LRUCache) Get(key Key) (value interface{}, ok bool) {
	defer c.mutex.Unlock()
	c.mutex.Lock()

	if ele, hit := c.cache[key]; hit {
		entry := ele.Value.(*cacheRecord)

		// If the entry has expired, remove it from the cache
		if entry.expireAt != nil && entry.expireAt.Before(time.Now().UTC()) {
			c.removeElement(ele)
			c.stats.Miss++
			return
		}
		c.stats.Hit++
		c.ll.MoveToFront(ele)
		return entry.value, true
	}
	c.stats.Miss++
	return
}
380720
func (c *SimpleLRUCache) Get(key string) (interface{}, bool) {
	data, ok := c.lruCache.Get(key)
	if data != nil && ok {
		var item cacheItem
		item, _ = data.(cacheItem)
		item.expires = timeFunc().Add(c.expiration) // update the expiration
		c.lruCache.Add(key, item)
		return item.value, true
	}
	return nil, false
}
125541
func (c *MemoryCache) Get(key string) (resp []byte, ok bool) {
	c.mu.RLock()
	resp, ok = c.items[key]
	c.mu.RUnlock()
	return resp, ok
}
1127792
func (m *lockingMap) Get(key string) (interface{}, bool) {
	m.keyLocker.RLock(key)
	defer m.keyLocker.RUnlock(key)

	m.lock.RLock()
	defer m.lock.RUnlock()

	val, ok := m.data[key]
	if ok && (m.checkFunc == nil || m.checkFunc(key, val)) {
		return val, true
	} else {
		// No value or it failed to check
		return nil, false
	}
}