[ENH]: Get Collection with segments impl#6147
Conversation
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Implement SysDB get_collection_with_segments feature Adds full stack support for retrieving a collection together with its segments through the SysDB gRPC service. The feature introduces internal request/response types, backend routing, Spanner query execution, and response conversion, plus test updates and CI adjustments. The implementation pulls collection, metadata, compaction cursor, and segment data in one Spanner join, reuses existing collection parsing, and constructs a consolidated response for the new Key Changes• Defined Affected Areas• rust/rust-sysdb/src/spanner.rs This summary was automatically generated by @propel-code-bot |
| // - Compaction cursor fields | ||
| let collection = Collection::try_from(rows)?; | ||
|
|
||
| let segments: Vec<Segment> = segments_map.into_values().collect(); |
There was a problem hiding this comment.
[Maintainability] The segments vector order is non-deterministic because it comes from a HashMap. For API consistency and testability, it's best practice to return lists in a deterministic order (e.g., sorted by segment ID).
| let segments: Vec<Segment> = segments_map.into_values().collect(); | |
| let mut segments: Vec<Segment> = segments_map.into_values().collect(); | |
| segments.sort_by_key(|s| s.id); |
Context for Agents
The `segments` vector order is non-deterministic because it comes from a `HashMap`. For API consistency and testability, it's best practice to return lists in a deterministic order (e.g., sorted by segment ID).
```suggestion
let mut segments: Vec<Segment> = segments_map.into_values().collect();
segments.sort_by_key(|s| s.id);
```
File: rust/rust-sysdb/src/spanner.rs
Line: 932496c205 to
8a070da
Compare
75c2da6 to
578c9ec
Compare
8a070da to
72e6926
Compare
578c9ec to
6588983
Compare
72e6926 to
9edc11b
Compare
6588983 to
8929be5
Compare
9edc11b to
92bccd8
Compare
8929be5 to
29a65f5
Compare
92bccd8 to
e6a9329
Compare
29a65f5 to
bf5478d
Compare
e6a9329 to
44b85fe
Compare
bf5478d to
e480dbb
Compare
44b85fe to
63068d6
Compare
e480dbb to
3fd3f10
Compare
63068d6 to
b3d6cc1
Compare
3fd3f10 to
7e28350
Compare
b3d6cc1 to
67038ee
Compare
d2ac304 to
c35ebab
Compare
67038ee to
1eca196
Compare
c35ebab to
0ca022f
Compare
aa7bf42 to
40e9e5c
Compare
5890dce to
8554390
Compare
tanujnay112
left a comment
There was a problem hiding this comment.
Accepting with comments
641be45 to
849806c
Compare

Description of changes
Summarize the changes made by this PR.
Test plan
How are these changes tested?
Added tests
pytestfor python,yarn testfor js,cargo testfor rustMigration plan
None
Observability plan
None
Documentation Changes
None