MCPcopy Create free account
hub / github.com/cortexproject/cortex / Fetch

Method Fetch

pkg/chunk/cache/memcached.go:135–145  ·  view source on GitHub ↗

Fetch gets keys from the cache. The keys that are found must be in the order of the keys requested.

(ctx context.Context, keys []string)

Source from the content-addressed store, hash-verified

133
134// Fetch gets keys from the cache. The keys that are found must be in the order of the keys requested.
135func (c *Memcached) Fetch(ctx context.Context, keys []string) (found []string, bufs [][]byte, missed []string) {
136 if c.cfg.BatchSize == 0 {
137 found, bufs, missed = c.fetch(ctx, keys)
138 return
139 }
140 _ = instr.CollectedRequest(ctx, "Memcache.GetBatched", c.requestDuration, memcacheStatusCode, func(ctx context.Context) error {
141 found, bufs, missed = c.fetchKeysBatched(ctx, keys)
142 return nil
143 })
144 return
145}
146
147func (c *Memcached) fetch(ctx context.Context, keys []string) (found []string, bufs [][]byte, missed []string) {
148 var items map[string]*memcache.Item

Callers

nothing calls this directly

Calls 2

fetchMethod · 0.95
fetchKeysBatchedMethod · 0.95

Tested by

no test coverage detected