refactor!: replace Snapshot::try_new_from
with SnapshotBuilder::from_snapshot
#1277
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.
Note
I'll split up this PR into more reviewable commits if we have alignment on this direction! also note the vast majority of this PR is either code movement or callsite updates.
What changes are proposed in this pull request?
Seeking some early feedback on integrating
Snapshot::try_new_from
intoSnapshotBuilder
. This PR has two major changes:Snapshot::try_new_from
intoSnapshotBuilder
with two pieces:a.
SnapshotBuilder::from_snapshot
to specify an existing snapshot for the builderb. Migrates all of the try_new_from implementation into
SnapshotBuilder::build
SnapshotBuilder
:a. to now optionally take a
table_root
- since the snapshot hint passed to the builder includes its own table_rootb. since
Snapshot::try_new_from
relies onArc
s to easily return snapshots that are unchanged from the existing snapshot,SnapshotBuilder::build()
now returns anArc<Snapshot>
instead of aSnapshot
This PR affects the following public APIs
Snapshot::try_new_from(existing)
withSnapshotBuilder::new().from_snapshot(existing)
SnapshotBuilder::build()
now returns anArc<Snapshot>
instead of aSnapshot
Snapshot::builder()
signature changed: now it accepts no parameters, and instead has a.with_table_root()
methodHow was this change tested?
existing