[rust] Add SnapshotId type alias and use it in snapshot metadata paths#657
Closed
Olawoyin007 wants to merge 1 commit into
Closed
[rust] Add SnapshotId type alias and use it in snapshot metadata paths#657Olawoyin007 wants to merge 1 commit into
Olawoyin007 wants to merge 1 commit into
Conversation
Follow-up to apache#635: TableId, PartitionId, and BucketId already have aliases in lib.rs, but snapshot_id was still spelled i64 everywhere. Add a matching SnapshotId alias and apply it to the hand-written sites: LakeSnapshot, LakeSnapshotInfo, KvSnapshot, KvSnapshotLeaseForBucket, the admin client methods, and the get_kv_snapshot_metadata / get_lake_snapshot request constructors.
Member
|
@Olawoyin007 Thank you for the PR, can you please move it to https://github.com/apache/fluss repository? Sorry for the inconvenience, we will soon archive this repo. |
Author
|
Moved to apache/fluss#3642 as requested, now that fluss-rust is merged into the monorepo. Closing this one - let's continue the review there. |
fresh-borzoni
pushed a commit
to apache/fluss
that referenced
this pull request
Jul 14, 2026
#3642) 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.
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
Linked issue: close #636
TableId,PartitionId, andBucketIdalready have type aliases inlib.rs(extended to the write path in #635), 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 inlib.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 test --workspace: 576 passed, 0 failed.cargo clippy --workspace --all-targetsandcargo fmt --all --checkare 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