Skip to content

refactor vcache and move loader to bsup/loader - #7428

Merged
mccanne merged 4 commits into
mainfrom
bsup-loader
Oct 8, 2026
Merged

mccanne merged 4 commits into
mainfrom
bsup-loader

Conversation

@mccanne

@mccanne mccanne commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

This moves the bsup loader code below the bsup package where it belongs and refactors the design so that column frames are exposed as one or more entities within a storage object. We stubbed out vcache a bit more, which is not yet used in the system (only for tests) but will become a pivotal part of the database storage layer.

Except for the small bits of refactoring, this commit is just moving and renaming things.

Comment thread bsup/loader/frame.go Outdated
// the super.Context in use is passed in for each vector constructed from
// its in-memory, sctx-independent shadow. This way one shadow can be used
// across multiple queries with different sctx.
type Frame struct {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I might not be seeing the big picture here but I think calling this FrameLoader would be clearer. Right you've got

loader := loader.NewFrame(colFrame)

which feels off because it looks like you're creating a frame and assigning it to loader. I think this looks more natural:

loader := loader.NewFrameLoader(colFrame)

Comment thread bsup/loader/frame.go Outdated
// storage and cached in memory so that subsequent calls run from memory.
// The vectors returned will have types from the provided sctx. Multiple
// Fetch calls to the same object may run concurrently.
func (f *Frame) Fetch(sctx *super.Context, projection field.Projection) (vector.Any, error) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Feels like this should be called Load.

Comment thread bsup/loader/frame.go Outdated
Comment on lines +33 to +35
loader := &loader{cctx, sctx, f.frame.DataReader()}
f.root = newShadow(cctx, f.frame.Root())
f.root.unmarshal(cctx, projection)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Do this in the same order as in FetrchUnordered.

Suggested change
loader := &loader{cctx, sctx, f.frame.DataReader()}
f.root = newShadow(cctx, f.frame.Root())
f.root.unmarshal(cctx, projection)
f.root = newShadow(cctx, f.frame.Root())
f.root.unmarshal(cctx, projection)
loader := &loader{cctx, sctx, f.frame.DataReader()}

This moves the bsup loader code below the bsup package where it
belongs and refactors the design so that column frames are exposed
as one or more entities within a storage object.  We stubbed out
vcache a bit more, which is not yet used in the system (only for tests)
but will become a pivotal part of the database storage layer.

Except for the small bits of refactoring, this commit is just moving
and renaming things.
@mccanne
mccanne merged commit 1379362 into main Oct 8, 2026
2 checks passed
@mccanne
mccanne deleted the bsup-loader branch October 8, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants