Skip to content

[rust] Add Fluss 1.x protocol support to the admin client#631

Open
gnuhpc wants to merge 4 commits into
apache:mainfrom
gnuhpc:pr/4-admin-methods
Open

[rust] Add Fluss 1.x protocol support to the admin client#631
gnuhpc wants to merge 4 commits into
apache:mainfrom
gnuhpc:pr/4-admin-methods

Conversation

@gnuhpc

@gnuhpc gnuhpc commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

What

Adds 27 new admin methods to FlussAdmin, consuming the message wrappers from #629/#630:

  • Database/table extensions: list_database_summaries, alter_database, alter_table, get_table_stats
  • KV snapshot operations: get_latest_kv_snapshots, get_kv_snapshot_metadata, create_kv_snapshot_lease, get_lake_snapshot
  • ACL management: create_acls, list_acls, drop_acls
  • Cluster configuration: describe_cluster_configs, alter_cluster_configs
  • Server management: add_server_tag, remove_server_tag, rebalance, list_rebalance_progress, cancel_rebalance
  • Producer offsets: register_producer_offsets, get_producer_offsets, delete_producer_offsets
  • Monitoring: get_cluster_health, list_remote_log_manifests
  • KV snapshots: list_kv_snapshots, release_kv_snapshot_lease, drop_kv_snapshot_lease

(The proto-compat fix for scanner.rs / admin.rs lives in #628 so that PR leaves the tree building.)

Stack

Part 4/6, stacked on #630#629#628. All target main.

🤖 Generated with Claude Code

- 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>
warmbupt and others added 3 commits June 20, 2026 02:45
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>
Add message wrappers for the remaining 1.x RPC APIs:
- KV snapshot lifecycle: acquire/release/drop lease, list, metadata,
  latest snapshots, lake snapshot
- Server management: add/remove server tag, rebalance + progress +
  cancel, get cluster health, list remote log manifests
- Producer offsets: register/get/delete
- ScanKv (API 1061): full KV-table bucket scan request/response
Add 27 new admin methods to FlussAdmin:
- Database/table extensions: list_database_summaries, alter_database,
  alter_table, get_table_stats
- KV snapshot operations: get_latest_kv_snapshots,
  get_kv_snapshot_metadata, create_kv_snapshot_lease, get_lake_snapshot
- ACL management: create_acls, list_acls, drop_acls
- Cluster configuration: describe_cluster_configs, alter_cluster_configs
- Server management: add_server_tag, remove_server_tag, rebalance,
  list_rebalance_progress, cancel_rebalance
- Producer offsets: register_producer_offsets, get_producer_offsets,
  delete_producer_offsets
- Monitoring: get_cluster_health, list_remote_log_manifests
- KV snapshots: list_kv_snapshots, release_kv_snapshot_lease,
  drop_kv_snapshot_lease
@gnuhpc gnuhpc force-pushed the pr/4-admin-methods branch from e4a4715 to 29a4d0b Compare June 19, 2026 19:05
@gnuhpc

gnuhpc commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto updated #630 and applied the same proto::*/Default cleanup the maintainer requested on #629 (#629 (review)) to every signature this PR adds. All 21 admin methods that previously leaked proto::Pb* in args or returns now take/return domain types. use crate::proto; is gone from admin.rs; only the pre-existing use crate::proto::GetTableInfoResponse; (from main) remains.

Response-side domain types added under crates/fluss/src/metadata/:

  • cluster_health.rsClusterHealth
  • kv_snapshot.rsKvSnapshot, LatestKvSnapshots, RemotePathAndLocalFile, KvSnapshotMetadata, AcquireKvSnapshotLeaseResult, ActiveKvSnapshots
  • lake_snapshot.rsLakeBucketSnapshot, LakeSnapshotInfo (distinct from the existing LakeSnapshot used by get_latest_lake_snapshot)
  • rebalance.rsRebalanceProgress, TableRebalanceProgress, BucketRebalanceProgress, BucketRebalancePlan
  • remote_log.rsRemoteLogManifestEntry
  • Extended config.rs (DescribeConfig), database.rs (DatabaseSummary), table_stats.rs (BucketStats/TableStats/BucketStatsError), acl.rs (CreateAclResult/DropAclsFilterResult/DropAclMatchingAcl), producer_offsets.rs (ProducerOffsets)

For trivially-shaped responses (single field), methods now return the primitive directly instead of wrapping — e.g. rebalance returns String (the rebalance id), register_producer_offsets returns Option<i32>, list_acls returns Vec<AclInfo>, list_remote_log_manifests returns Vec<RemoteLogManifestEntry>.

alter_table parameter fix (same drop-silently-features class as target_columns in #629): previously took only config_changes + add_columns and hardcoded vec![],vec![],vec![] for drop/rename/modify columns. Now takes an AlterTableChanges bundle struct (avoids clippy::too_many_arguments) exposing all 5 change types, plus ignore_if_not_exists is now a parameter instead of hardcoded false.

#[derive(Default)] not present anywhere in this PR (admin.rs has none); the wrappers consumed are already cleaned up on #629/#630.

cargo build + clippy (-D warnings) + 556 unit tests pass locally. Pushed 29a4d0b.

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.

2 participants