Skip to content

Conversation

@dongxiao1198
Copy link
Contributor

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.

return new_schema_id;
}

Status TableMetadataBuilder::Impl::SetRef(const std::string& name,
Copy link
Member

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?

Copy link
Contributor Author

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) {
Copy link
Member

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(
Copy link
Member

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;
Copy link
Member

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);

Copy link
Contributor Author

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

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