MCPcopy Index your code
hub / github.com/kopia/kopia / PrefetchBackingContents

Function PrefetchBackingContents

repo/object/object_manager.go:204–214  ·  view source on GitHub ↗

PrefetchBackingContents attempts to brings contents backing the provided object IDs into the cache. This may succeed only partially due to cache size limits and other. Returns the list of content IDs prefetched.

(ctx context.Context, contentMgr contentManager, objectIDs []ID, hint string)

Source from the content-addressed store, hash-verified

202// This may succeed only partially due to cache size limits and other.
203// Returns the list of content IDs prefetched.
204func PrefetchBackingContents(ctx context.Context, contentMgr contentManager, objectIDs []ID, hint string) ([]content.ID, error) {
205 tracker := &contentIDTracker{}
206
207 for _, oid := range objectIDs {
208 if err := iterateBackingContents(ctx, contentMgr, oid, tracker, noop); err != nil && !errors.Is(err, ErrObjectNotFound) && !errors.Is(err, content.ErrContentNotFound) {
209 return nil, err
210 }
211 }
212
213 return contentMgr.PrefetchContents(ctx, tracker.contentIDs(), hint), nil
214}
215
216// NewObjectManager creates an ObjectManager with the specified content manager and format.
217func NewObjectManager(_ context.Context, bm contentManager, f format.ObjectFormat, mr *metrics.Registry) (*Manager, error) {

Callers 2

PrefetchObjectsMethod · 0.92
PrefetchObjectsMethod · 0.92

Calls 3

contentIDsMethod · 0.95
iterateBackingContentsFunction · 0.85
PrefetchContentsMethod · 0.65

Tested by

no test coverage detected