[rust] Add SnapshotId type alias and use it in snapshot metadata paths#3642
Merged
fresh-borzoni merged 1 commit intoJul 14, 2026
Merged
Conversation
TableId, PartitionId, and BucketId already have type aliases in lib.rs, but snapshot_id was still spelled i64 everywhere. Add a matching SnapshotId alias so snapshot-related signatures read consistently with the other ID types. Applied to the hand-written sites: LakeSnapshot (metadata/table.rs), LakeSnapshotInfo, KvSnapshot, KvSnapshotLeaseForBucket, the admin client methods (get_kv_snapshot_metadata, get_lake_snapshot), and the GetKvSnapshotMetadataRequest / GetLakeSnapshotRequest constructors. Generated proto code is untouched; HashMap<TableBucket, i64> offset values stay i64 since they are offsets, not snapshot IDs. No behavior change (the alias resolves to the same type). Ported from apache/fluss-rust#657 at the maintainer's request after the fluss-rust repo was merged into this monorepo.
Contributor
Author
|
@fresh-borzoni moved here from apache/fluss-rust#657 as requested (the change now lives under |
fresh-borzoni
approved these changes
Jul 14, 2026
fresh-borzoni
left a comment
Member
There was a problem hiding this comment.
@Olawoyin007 Thank you for the PR, LGTM 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Purpose
Moved from apache/fluss-rust#657 at @fresh-borzoni's request, now that the
fluss-rustrepo has been merged into this monorepo. Original issue: apache/fluss-rust#636.TableId,PartitionId, andBucketIdalready have type aliases inlib.rs, butsnapshot_idwas still spelledi64everywhere. This adds a matchingSnapshotIdalias so snapshot-related signatures read consistently with the other ID types.Brief change log
pub type SnapshotId = i64;next to the existing aliases influss-rust/crates/fluss/src/lib.rs.LakeSnapshot(metadata/table.rs),LakeSnapshotInfo,KvSnapshot,KvSnapshotLeaseForBucket, the admin client methods (get_kv_snapshot_metadata,get_lake_snapshot), and theGetKvSnapshotMetadataRequest/GetLakeSnapshotRequestconstructors.HashMap<TableBucket, i64>offset values stayi64since they are offsets, not snapshot IDs.Tests
No behavior change (the alias resolves to the same type).
cargo build -p fluss-rs,cargo test -p fluss-rs --lib(571 passed, 0 failed), andcargo fmt -p fluss-rs --checkare all clean.API and Format
Public signatures now name
SnapshotIdinstead ofi64; since it is a plain type alias, this is source- and ABI-compatible. No storage format impact.Documentation
No new feature; no documentation changes needed.
🤖 Generated with Claude Code