[rust] Add RPC message wrappers for core DB/table operations#629
Conversation
fresh-borzoni
left a comment
There was a problem hiding this comment.
@gnuhpc Thank you for the PR, we need to address a couple of issues here.
We shouldn't use proto::* in any public FlussAdmin signature.
Please, define domain types mirroring Java's with conversion in the wrapper layer
| inner_request: proto::GetTableStatsRequest { | ||
| table_id, | ||
| buckets_req, | ||
| target_columns: vec![], |
There was a problem hiding this comment.
why do we hardcode target_columns: vec![]?
There's no way to ask for specific columns with this, is it intentional?
There was a problem hiding this comment.
Not intentional — fixed in 720d069. GetTableStatsRequest::new now takes target_columns: Vec<i32> and threads it through. Single existing call site (the integration test on #632) will pass an explicit vec![] to preserve current behavior. Same drop-silently-features pattern also fixed on #631 (alter_table was hardcoding vec![] for drop/rename/modify columns); will be in the next force-push on that PR.
| use bytes::{Buf, BufMut}; | ||
| use prost::Message; | ||
|
|
||
| #[derive(Debug, Default)] |
There was a problem hiding this comment.
Can we drop #[derive(Default)] on the arg-taking requests?
default() just builds empty(invalid requests), and the rest of the wrappers are #[derive(Debug)] only, so it's inconsistent
There was a problem hiding this comment.
Done in 720d069. Dropped #[derive(Default)] on all 7 arg-taking wrappers added by this PR (alter_cluster_configs, alter_database, alter_table, create_acls, drop_acls, get_table_stats, list_acls).
Kept Default on the param-less ones (describe_cluster_configs, list_database_summaries) since they match the pre-existing list_databases.rs precedent and default() produces a valid request there — happy to drop those too if you'd prefer strict uniformity.
Same change applied to the 18 arg-taking wrappers on #630.
784f39d to
720d069
Compare
|
Addressed the Domain types introduced under
Enum int codes are taken verbatim from the Java source ( Wrapper changes: all 7 arg-taking wrappers' Stack-wide sweep: since the same Tests: added Thanks for the review! |
720d069 to
a6bb958
Compare
Add 9 RPC message wrapper types: - alter_database, alter_table (DDL operations) - get_table_stats (table statistics) - list_database_summaries (database listing with summaries) - create_acls, list_acls, drop_acls (ACL management) - describe_cluster_configs, alter_cluster_configs (cluster configuration) Each wrapper follows the standard pattern: a request struct wrapping the proto-generated type, implementing RequestBody (tying to ApiKey and ResponseBody), WriteType, and ReadType. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
a6bb958 to
3e2c989
Compare
fresh-borzoni
left a comment
There was a problem hiding this comment.
@gnuhpc Thank you for the changes, LGTM
I pushed commit to tighten visibility for protos in your new code and a couple of pre-existing issues. Hope it's okay with you
3e2c989 to
f0b606e
Compare
f0b606e to
775ee07
Compare
What
Adds request/response message wrappers for the core 1.x DB/table admin RPCs:
AlterClusterConfigs,AlterDatabase,AlterTable,CreateAcls,DescribeClusterConfigs,DropAcls,GetTableStats,ListAcls,ListDatabaseSummaries.Each is a thin wrapper over the generated
proto::types (from #628) wired intorpc/message/mod.rs. The admin client methods that consume them land in a later PR.Stack
Part 2/6 of the Fluss 1.x Rust support series, stacked on #628 (
pr/1-proto-sync). Each branch in the stack compiles on top of its predecessor, so all PRs here targetmain; once #628 merges, this PR's diff automatically reduces to just the 9 message files unique to this branch.🤖 Generated with Claude Code