Skip to content
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

Replace GetContainingDigests() with VirtualApply() #155

Merged
merged 3 commits into from
Dec 9, 2024

Conversation

EdSchouten
Copy link
Member

Right now we have completely different code paths for computing the containing digests for files and directories. For files we call LinkableLeaf.VirtualApply(), while for directories we call InitialContentsFetcher.GetContainingDigests().

The downside of the current approach is that generic virtual file system APIs are strongly coupled against REv2. By giving InitialContentsFetcher a VirtualApply(), we get rid of the coupling. In addition to that, it's now possible to call InitialChild.GetNode().VirtualApply() to obtain the set of containing digests in a file type oblivious way.

I want to add a common interface for Leaf and InitialContentsFetcher. I
think the best name for that is InitialNode, but that name is already
taken. Rename the existing InitialNode type to InitialChild, which is a
better fit, because it's based on Child.
At the call site we could just check the return value of VirtualApply()
to see whether this operation is actually implemented by the files in
question.
Right now we have completely different code paths for computing the
containing digests for files and directories. For files we call
LinkableLeaf.VirtualApply(), while for directories we call
InitialContentsFetcher.GetContainingDigests().

The downside of the current approach is that generic virtual file system
APIs are strongly coupled against REv2. By giving InitialContentsFetcher
a VirtualApply(), we get rid of the coupling. In addition to that, it's
now possible to call InitialChild.GetNode().VirtualApply() to obtain the
set of containing digests in a file type oblivious way.
@EdSchouten EdSchouten merged commit b7b3bc4 into master Dec 9, 2024
1 check passed
@EdSchouten EdSchouten deleted the eschouten/20241209-icf branch December 9, 2024 21:21
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.

1 participant