-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Core: Call the replaceCurrentSnapshot with snapshotId for rollback operations #4135
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -501,6 +501,10 @@ public TableMetadata replaceCurrentSnapshot(Snapshot snapshot) { | |
| return new Builder(this).setCurrentSnapshot(snapshot).build(); | ||
| } | ||
|
|
||
| public TableMetadata replaceCurrentSnapshot(long snapshotId) { | ||
| return new Builder(this).setCurrentSnapshot(snapshotId).build(); | ||
| } | ||
|
|
||
|
Comment on lines
+504
to
+507
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this was an oversight, right? We don't need this new method; it is not used.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that's right. I missed this.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I filed #4155 to remove the unused methods. |
||
| public TableMetadata removeSnapshotsIf(Predicate<Snapshot> removeIf) { | ||
| List<Snapshot> toRemove = snapshots.stream().filter(removeIf).collect(Collectors.toList()); | ||
| return new Builder(this).removeSnapshots(toRemove).build(); | ||
|
|
||
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.
Can you port the changes from the other fix? That removed methods from
TableMetadatarather than adding new ones. I think it would be best to keep 0.13.x and master in sync rather than having slightly different fixes.Thanks, @sririshindra!
Uh oh!
There was an error while loading. Please reload this page.
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.
@rdblue, would the following be acceptable? (from line 285)
I know the point of #4089 is to replace
setCurrentSnapshotwithsetBranchSnapshot, but in 0.13.x, we don't support branching yet, and the commits #4089 builds on are not present. The above mirrors your change toSnapshotProducerin #4089.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.
Yes, calling the right
setCurrentSnapshotis a good way to backport this. Thanks!