Skip to content

[rust] Add RPC message wrappers for core DB/table operations#629

Open
gnuhpc wants to merge 2 commits into
apache:mainfrom
gnuhpc:pr/2-rpc-messages-core
Open

[rust] Add RPC message wrappers for core DB/table operations#629
gnuhpc wants to merge 2 commits into
apache:mainfrom
gnuhpc:pr/2-rpc-messages-core

Conversation

@gnuhpc

@gnuhpc gnuhpc commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

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 into rpc/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 target main; once #628 merges, this PR's diff automatically reduces to just the 9 message files unique to this branch.

🤖 Generated with Claude Code

warmbupt and others added 2 commits June 18, 2026 11:44
- Update fluss_api.proto with all 1.x message types (ACLs, KV snapshots,
  producer offsets, cluster config, rebalance, server tags, etc.)
- Add optional fields: rack, remote_data_dir, leader_epoch, agg_mode, etc.
- Register 24 new ApiKey variants (1023-1064) in api_key.rs
- Update build.rs prost bytes config for new proto fields
- Add None defaults in convert.rs and partition.rs
- Update pre-existing message wrappers that reference renamed proto fields /
  ApiKey variants so the crate still builds:
    * create_partition.rs: ignore_if_exists -> ignore_if_not_exists
    * get_latest_lake_snapshot.rs: ApiKey::GetLatestLakeSnapshot -> GetLakeSnapshot
    * list_databases.rs: populate new include_summary field
    * lookup.rs: PbLookupReqForBucket.key -> keys; new LookupRequest fields

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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>

@fresh-borzoni fresh-borzoni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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![],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we hardcode target_columns: vec![]?
There's no way to ask for specific columns with this, is it intentional?

use bytes::{Buf, BufMut};
use prost::Message;

#[derive(Debug, Default)]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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.

3 participants