proxy/grpcproxy/cache/store.go
func (c *cache) Get(req *pb.RangeRequest) (*pb.RangeResponse, error) {
	key := keyFunc(req)

	c.mu.Lock()
	defer c.mu.Unlock()

	if req.Revision > 0 && req.Revision < c.compactedRev {
		c.lru.Remove(key)
		return nil, ErrCompacted
	}

	if resp, ok := c.lru.Get(key); ok {
		return resp.(*pb.RangeResponse), nil
	}
	return nil, errors.New("not exist")
}
func (c *cache) Get(req *pb.RangeRequest) (*pb.RangeResponse, error) {
	key := keyFunc(req)

	c.mu.Lock()
	defer c.mu.Unlock()

	if req.Revision > 0 && req.Revision < c.compactedRev {
		c.lru.Remove(key)
		return nil, ErrCompacted
	}

	if resp, ok := c.lru.Get(key); ok {
		return resp.(*pb.RangeResponse), nil
	}
	return nil, errors.New("not exist")
}
func ( c * cache ) Get ( req * pb . RangeRequest ) ( * pb . RangeResponse , error ) { key := keyFunc ( req ) c . mu . Lock ( ) defer c . mu . Unlock ( ) if req . Revision > 0 && req . Revision < c . compactedRev { c . lru . Remove ( key ) return nil , ErrCompacted } if resp , ok := c . lru . Get ( key ) ; ok { return resp . ( * pb . RangeResponse ) , nil } return nil , errors . New ( " " ) }
// Get looks up the caching response for a given request.
// Get is also responsible for lazy eviction when accessing compacted entries.
Get looks up the caching response for a given request . Get is also responsible for lazy eviction when accessing compacted entries .