-
Notifications
You must be signed in to change notification settings - Fork 182
Split seekable files from non-seekable files #1361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
this allows us to cache, compress, etc.
dobrac
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good. Small nits there, so approving!
Just wondering, wouldn't it be better to do instead of:
obj, err := s.OpenObject(ctx, files.StorageMetadataPath(), storage.MetadataObjectType)
something like this?
obj, err := s.OpenObject(ctx, storage.MetadataObjectType{ Path: files.StorageMetadataPath()})
(we could then return the storage.MetadataObjectType directly instead of the string path)
This allows us to cache, compress, etc.
OpenSeekableObjectmethod to the storage provider that is used to read seekable filesReadAtmethod from theObjectProviderinterface (only used bySeekableObjectProvider).Deletemethod from theObjectProviderinterface (never used).SeekableObjectProviderinterface.ObjectTypeandSeekableObjectTypetypes that defines which file type is being passed in, in order to help the compiler prevent mistakesNote
Introduces separate seekable/non-seekable storage interfaces with typed OpenObject/OpenSeekableObject, updates providers, caching, orchestrator code, mocks, and tests accordingly.
ObjectProvider(non-seekable) andSeekableObjectProvider(seekable); removedReadAt/DeletefromObjectProvider, addedExists.ObjectTypeandSeekableObjectTypeenums; updatedStorageProviderwithOpenObject(ctx, path, ObjectType)andOpenSeekableObject(ctx, path, SeekableObjectType).CachedObjectProviderandCachedSeekableObjectProvider; moved chunked read/size logic to seekable cache; reorganized cache helpers.Exists; adjustedOpenObject/OpenSeekableObjectsignatures.OpenSeekableObjectfor memfile/rootfs andOpenObjectfor headers/metadata/snapfile.storage_diff: constructor now returns(*StorageDiff, error); added diff→object type mapping; useOpenSeekableObject.Existsinstead ofSize.mockobjectproviderandmockseekableobjectprovider; updated unit tests for new interfaces and behaviors..mockery.yamlupdated to generate mocks for new interfaces.Written by Cursor Bugbot for commit 77c3db5. This will update automatically on new commits. Configure here.