You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fluss.apache.org by "gnuhpc (via GitHub)" <gi...@apache.org> on 2026/06/19 01:10:46 UTC

[PR] [rust] Add RPC message wrappers for extended operations [fluss-rust]

gnuhpc opened a new pull request, #630:
URL: https://github.com/apache/fluss-rust/pull/630

   ## What
   
   Adds 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
   
   Wired into `rpc/message/mod.rs`. `scan_kv.rs` is consumed by the `KvBatchScanner` in the final PR of the series.
   
   ## Stack
   
   Part **3/6**, stacked on #629 (`pr/2-rpc-messages-core`) → #628. All target `main`; each branch compiles on its predecessor, so diffs shrink to this branch's unique files as the base PRs merge.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [rust] Add RPC message wrappers for extended operations [fluss-rust]

Posted by "gnuhpc (via GitHub)" <gi...@apache.org>.
gnuhpc commented on PR #630:
URL: https://github.com/apache/fluss-rust/pull/630#issuecomment-4785212019

   @fresh-borzoni Done. Force-pushed the stack:
   - **#630**: added a commit applying `TableId`/`PartitionId`/`BucketId` aliases to the 5 RPC message wrappers (`get_kv_snapshot_metadata`, `get_table_stats`, `limit_scan`, `list_kv_snapshots`, `list_remote_log_manifests`).
   - **#631**: matching aliases applied to the corresponding admin methods.
   - **#633**: the bindings-fix commit now contains only the C++/Elixir binding changes.
   
   `cargo build --workspace` and `cargo fmt --all --check` clean on all four branches.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [rust] Add RPC message wrappers for extended operations [fluss-rust]

Posted by "gnuhpc (via GitHub)" <gi...@apache.org>.
gnuhpc commented on code in PR #630:
URL: https://github.com/apache/fluss-rust/pull/630#discussion_r3449552302


##########
crates/fluss/src/rpc/message/rebalance.rs:
##########
@@ -0,0 +1,44 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use crate::rpc::api_key::ApiKey;
+use crate::rpc::frame::{ReadError, WriteError};
+use crate::rpc::message::{ReadType, RequestBody, WriteType};
+use crate::{impl_read_type, impl_write_type, proto};
+use bytes::{Buf, BufMut};
+use prost::Message;
+
+#[derive(Debug)]
+pub struct RebalanceRequest {
+    pub(crate) inner_request: proto::RebalanceRequest,
+}
+
+impl RebalanceRequest {
+    pub fn new(goals: Vec<i32>) -> Self {

Review Comment:
   Done. Added `GoalType` enum under `metadata/` with `to_i32()`/`try_from_i32()`. The `new()` signature now takes `Vec<GoalType>` directly.



##########
crates/fluss/src/rpc/message/add_server_tag.rs:
##########
@@ -0,0 +1,47 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use crate::rpc::api_key::ApiKey;
+use crate::rpc::frame::{ReadError, WriteError};
+use crate::rpc::message::{ReadType, RequestBody, WriteType};
+use crate::{impl_read_type, impl_write_type, proto};
+use bytes::{Buf, BufMut};
+use prost::Message;
+
+#[derive(Debug)]
+pub struct AddServerTagRequest {
+    pub(crate) inner_request: proto::AddServerTagRequest,
+}
+
+impl AddServerTagRequest {
+    pub fn new(server_ids: Vec<i32>, server_tag: i32) -> Self {

Review Comment:
   Done. Added `ServerTag` enum under `metadata/` with `to_i32()`/`try_from_i32()`. Both `add_server_tag` and `remove_server_tag` wrappers now take `ServerTag` directly.



##########
crates/fluss/src/rpc/message/remove_server_tag.rs:
##########
@@ -0,0 +1,47 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use crate::rpc::api_key::ApiKey;
+use crate::rpc::frame::{ReadError, WriteError};
+use crate::rpc::message::{ReadType, RequestBody, WriteType};
+use crate::{impl_read_type, impl_write_type, proto};
+use bytes::{Buf, BufMut};
+use prost::Message;
+
+#[derive(Debug)]
+pub struct RemoveServerTagRequest {
+    pub(crate) inner_request: proto::RemoveServerTagRequest,
+}
+
+impl RemoveServerTagRequest {
+    pub fn new(server_ids: Vec<i32>, server_tag: i32) -> Self {

Review Comment:
   Done. Same as above.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [rust] Add RPC message wrappers for extended operations [fluss-rust]

Posted by "fresh-borzoni (via GitHub)" <gi...@apache.org>.
fresh-borzoni merged PR #630:
URL: https://github.com/apache/fluss-rust/pull/630


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [rust] Add RPC message wrappers for extended operations [fluss-rust]

Posted by "gnuhpc (via GitHub)" <gi...@apache.org>.
gnuhpc commented on PR #630:
URL: https://github.com/apache/fluss-rust/pull/630#issuecomment-4759225744

   @fresh-borzoni Rebased on current main and applied the `pub(crate)` visibility tightening from 775ee07 to all 19 new wrapper types on this PR (and `pub(crate) fn new` on `ScanKvRequest`). Domain types, enum mappings, and `Default` drops are unchanged.
   
   Verified end-to-end against real Java Fluss servers in Docker:
   - **0.9.1-incubating**: 68/68 integration tests pass (including 15 admin_extended tests for the new wrappers — APIs not supported on 0.9.x tolerate `UnsupportedVersion` per design)
   - **1.0-SNAPSHOT-dev** (built from apache/fluss main): 73/73 integration tests pass (the extra 5 are `admin_v1` tests gated behind the `fluss_v1` feature for 1.x-only APIs)
   
   Plus unit tests (557 passed), `cargo fmt --all --check`, and `cargo clippy --all-targets -- -D warnings` all clean on every branch in the stack.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [rust] Add RPC message wrappers for extended operations [fluss-rust]

Posted by "fresh-borzoni (via GitHub)" <gi...@apache.org>.
fresh-borzoni commented on code in PR #630:
URL: https://github.com/apache/fluss-rust/pull/630#discussion_r3448468327


##########
crates/fluss/src/rpc/message/add_server_tag.rs:
##########
@@ -0,0 +1,47 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use crate::rpc::api_key::ApiKey;
+use crate::rpc::frame::{ReadError, WriteError};
+use crate::rpc::message::{ReadType, RequestBody, WriteType};
+use crate::{impl_read_type, impl_write_type, proto};
+use bytes::{Buf, BufMut};
+use prost::Message;
+
+#[derive(Debug)]
+pub struct AddServerTagRequest {
+    pub(crate) inner_request: proto::AddServerTagRequest,
+}
+
+impl AddServerTagRequest {
+    pub fn new(server_ids: Vec<i32>, server_tag: i32) -> Self {

Review Comment:
   ditto



##########
crates/fluss/src/rpc/message/remove_server_tag.rs:
##########
@@ -0,0 +1,47 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use crate::rpc::api_key::ApiKey;
+use crate::rpc::frame::{ReadError, WriteError};
+use crate::rpc::message::{ReadType, RequestBody, WriteType};
+use crate::{impl_read_type, impl_write_type, proto};
+use bytes::{Buf, BufMut};
+use prost::Message;
+
+#[derive(Debug)]
+pub struct RemoveServerTagRequest {
+    pub(crate) inner_request: proto::RemoveServerTagRequest,
+}
+
+impl RemoveServerTagRequest {
+    pub fn new(server_ids: Vec<i32>, server_tag: i32) -> Self {

Review Comment:
   ditto



##########
crates/fluss/src/rpc/message/rebalance.rs:
##########
@@ -0,0 +1,44 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use crate::rpc::api_key::ApiKey;
+use crate::rpc::frame::{ReadError, WriteError};
+use crate::rpc::message::{ReadType, RequestBody, WriteType};
+use crate::{impl_read_type, impl_write_type, proto};
+use bytes::{Buf, BufMut};
+use prost::Message;
+
+#[derive(Debug)]
+pub struct RebalanceRequest {
+    pub(crate) inner_request: proto::RebalanceRequest,
+}
+
+impl RebalanceRequest {
+    pub fn new(goals: Vec<i32>) -> Self {

Review Comment:
   Shall we do this enum?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [rust] Add RPC message wrappers for extended operations [fluss-rust]

Posted by "fresh-borzoni (via GitHub)" <gi...@apache.org>.
fresh-borzoni commented on PR #630:
URL: https://github.com/apache/fluss-rust/pull/630#issuecomment-4755319938

   @gnuhpc Can you pls, rebase/cherry-pick on top of current main and fix proto visibility in a similar fashion as I did in previous PR?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [rust] Add RPC message wrappers for extended operations [fluss-rust]

Posted by "gnuhpc (via GitHub)" <gi...@apache.org>.
gnuhpc commented on PR #630:
URL: https://github.com/apache/fluss-rust/pull/630#issuecomment-4754037757

   Rebased onto updated #629 and proactively applied the same `proto::*`/`Default` cleanup that the maintainer requested on #629 (https://github.com/apache/fluss-rust/pull/629#pullrequestreview-4533670812):
   
   **Domain types added** (`crates/fluss/src/metadata/`):
   - `kv_snapshot_lease.rs` — `KvSnapshotLeaseForTable` + `KvSnapshotLeaseForBucket`
   - `producer_offsets.rs` — `ProducerTableOffsets` + `BucketOffset`
   - Extended `table.rs` — added `to_pb`/`from_pb` to existing `TableBucket`
   
   **Wrapper signatures**: 3 wrappers that took raw `proto::Pb*` in `new()` now take domain types (`acquire_kv_snapshot_lease`, `register_producer_offsets`, `release_kv_snapshot_lease`).
   
   **`#[derive(Default)]` dropped** on the 17 arg-taking wrappers in this PR (kept on `get_cluster_health` which is param-less, matching the pre-existing `list_databases.rs` precedent).
   
   **Not changed** (yet): `scan_kv.rs` retains `Vec<proto::PbScanReqForBucket>` in its `new()` for now. The wrapper has no consumer on this branch (its caller `KvBatchScanner` lands in #633), and making it `pub(crate)` here triggers `cargo clippy --all-targets -- -D warnings` failures from dead-code lints. I'll address it on #633 when the consumer arrives — either by adding a `ScanReqForBucket` domain type or by making the wrapper crate-private once it actually has a use site.
   
   cargo build + clippy (`-D warnings`) + 548 unit tests pass locally. Pushed `9d2fbff`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org