-
Notifications
You must be signed in to change notification settings - Fork 79
feat: support expire snapshots #490
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
base: main
Are you sure you want to change the base?
Conversation
| return new_schema_id; | ||
| } | ||
|
|
||
| Status TableMetadataBuilder::Impl::SetRef(const std::string& name, |
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.
#408 is adding SetRef and AddSnapshot. Perhaps we should wait for it to be merged and leave them as not implemented for now?
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.
Agree. This pr depends on the implement of SetRef and AddSnapshot, I will rebase code after #408 to avoiding conflict
| return {}; | ||
| } | ||
|
|
||
| Status TableMetadataBuilder::Impl::RemoveRef(const std::string& name) { |
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.
This does not align with the Java impl:
public Builder removeRef(String name) {
if (SnapshotRef.MAIN_BRANCH.equals(name)) {
this.currentSnapshotId = -1;
}
SnapshotRef ref = refs.remove(name);
if (ref != null) {
changes.add(new MetadataUpdate.RemoveSnapshotRef(name));
}
return this;
}| return {}; | ||
| } | ||
|
|
||
| Status TableMetadataBuilder::Impl::RemoveSnapshots( |
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.
This does not align with the Java imp either.
| } | ||
|
|
||
| ExpireSnapshots& ExpireSnapshots::CleanupLevel(enum CleanupLevel level) { | ||
| cleanup_level_ = level; |
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.
Java impl has this check:
Preconditions.checkArgument(
cleanExpiredFiles || level == CleanupLevel.NONE,
"Cannot set cleanupLevel to %s when cleanExpiredFiles was explicitly set to false",
level);
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.
cleanExpiredFiles was deprecated in lastest version
3b03dba to
42d7071
Compare
This PR is part1 implements to support expire snapshots described in issue #364.
1 Add ExpireSnapshot in TableMetadataBuilder,Table,Transaction...
2 Add basic UT for TableMetadataBuilder and E2E with in memory catalog
TODO: FileCleanupStrategy and file recycle need another independent PR to do,and need more UT after all part finished.