MCPcopy Create free account
hub / github.com/AbelChe/evil_minio / statCachedMeta

Method statCachedMeta

cmd/disk-cache-backend.go:508–517  ·  view source on GitHub ↗

statCachedMeta returns metadata from cache - including ranges cached, partial to indicate if partial object is cached.

(ctx context.Context, cacheObjPath string)

Source from the content-addressed store, hash-verified

506// statCachedMeta returns metadata from cache - including ranges cached, partial to indicate
507// if partial object is cached.
508func (c *diskCache) statCachedMeta(ctx context.Context, cacheObjPath string) (meta *cacheMeta, partial bool, numHits int, err error) {
509 cLock := c.NewNSLockFn(cacheObjPath)
510 lkctx, err := cLock.GetRLock(ctx, globalOperationTimeout)
511 if err != nil {
512 return
513 }
514 ctx = lkctx.Context()
515 defer cLock.RUnlock(lkctx)
516 return c.statCache(ctx, cacheObjPath)
517}
518
519// statRange returns ObjectInfo and RangeInfo from disk cache
520func (c *diskCache) statRange(ctx context.Context, bucket, object string, rs *HTTPRangeSpec) (oi ObjectInfo, rngInfo RangeInfo, numHits int, err error) {

Callers 4

purgeMethod · 0.95
StatMethod · 0.95
statRangeMethod · 0.95

Calls 4

statCacheMethod · 0.95
ContextMethod · 0.80
GetRLockMethod · 0.65
RUnlockMethod · 0.65

Tested by

no test coverage detected