Split seekable files from non-seekable files #1361
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This allows us to cache, compress, etc.
OpenSeekableObject
method to the storage provider that is used to read seekable filesReadAt
method from theObjectProvider
interface (only used bySeekableObjectProvider
).Delete
method from theObjectProvider
interface (never used).SeekableObjectProvider
interface.ObjectType
andSeekableObjectType
types that defines which file type is being passed in, in order to help the compiler prevent mistakesNote
Split storage API into typed seekable and non-seekable object interfaces with OpenObject/OpenSeekableObject, updating providers, caching, mocks, tests, and orchestrator code to use explicit object types.
ObjectType
andSeekableObjectType
enums and new interfaces:ObjectProvider
(non-seekable) andSeekableObjectProvider
(seekable).StorageProvider
now exposesOpenObject(ctx, path, objectType)
andOpenSeekableObject(ctx, path, seekableObjectType)
.MemfileObjectType
,RootFSObjectType
,MemfileHeaderObjectType
,SnapfileObjectType
,MetadataObjectType
,LayerObjectType
,LayerMetadataObjectType
.Exists
on non-seekable objects; helperignoreNotExists
(AWS) and typed open methods.CachedObjectProvider
(full-file) andCachedSeekableObjectProvider
(chunkedReadAt
/Size
); reorganize cache code intostorage_cache_object.go
andstorage_cache_seekable.go
.CachedProvider
updated to wrap bothOpenObject
andOpenSeekableObject
.OpenSeekableObject
withstorage.MemfileObjectType
/storage.RootFSObjectType
and headers/metadata toOpenObject
with typedObjectType
.obj.Exists(ctx)
instead ofSize
.StorageObjectProvider
mocks withObjectProvider
and addSeekableObjectProvider
mocks; update usages.Exists
and delete via provider)..mockery.yaml
to generate new mocks and filenames.Written by Cursor Bugbot for commit 85a22ac. This will update automatically on new commits. Configure here.