MCPcopy Create free account
hub / github.com/dgraph-io/dgraph-benchmarks / Get

Method Get

cachebench/cache_bench_test.go:300–312  ·  view source on GitHub ↗
(key []byte)

Source from the content-addressed store, hash-verified

298}
299
300func (m *SyncMap) Get(key []byte) ([]byte, error) {
301 v, ok := m.c.Load(string(key))
302 if !ok {
303 return nil, errKeyNotFound
304 }
305
306 tv, ok := v.([]byte)
307 if !ok {
308 return nil, errInvalidValue
309 }
310
311 return tv, nil
312}
313
314func (m *SyncMap) Set(key, value []byte) error {
315 // We are not performing any initialization here unlike other caches

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected