MCPcopy
hub / github.com/cubefs/cubefs / load

Method load

client/blockcache/bcache/manage.go:266–280  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

264}
265
266func (bm *bcacheManager) load(key string) (ReadCloser, error) {
267 if len(bm.bstore) == 0 {
268 return nil, errors.New("no cache dir")
269 }
270 f, err := bm.selectDiskKv(key).load(key)
271 if err != nil {
272 return nil, err
273 }
274 bm.Lock()
275 defer bm.Unlock()
276 if element, ok := bm.bcacheKeys[key]; ok {
277 bm.lrulist.MoveToBack(element)
278 }
279 return f, err
280}
281
282func (bm *bcacheManager) erase(key string) {
283 if len(bm.bstore) == 0 {

Callers 1

readMethod · 0.95

Calls 6

selectDiskKvMethod · 0.95
NewFunction · 0.92
LockMethod · 0.80
MoveToBackMethod · 0.80
loadMethod · 0.65
UnlockMethod · 0.45

Tested by

no test coverage detected