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)
| 202 | // This may succeed only partially due to cache size limits and other. |
| 203 | // Returns the list of content IDs prefetched. |
| 204 | func 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. |
| 217 | func NewObjectManager(_ context.Context, bm contentManager, f format.ObjectFormat, mr *metrics.Registry) (*Manager, error) { |
no test coverage detected