fxbing commented on code in PR #622:
URL: https://github.com/apache/fluss-rust/pull/622#discussion_r3425289169


##########
crates/fluss/src/cluster/mod.rs:
##########
@@ -77,20 +79,23 @@ impl ServerNode {
 pub enum ServerType {
     TabletServer,
     CoordinatorServer,
+    Unknown,

Review Comment:
   Updated the Rust API reference to include `ServerType::Unknown` and 
documented that it is used when the client has not yet determined the endpoint 
type, such as bootstrap endpoints.



##########
crates/fluss/src/cluster/mod.rs:
##########
@@ -77,20 +79,23 @@ impl ServerNode {
 pub enum ServerType {
     TabletServer,
     CoordinatorServer,
+    Unknown,
 }
 
 impl ServerType {
     pub fn to_type_id(&self) -> i32 {
         match self {
             ServerType::CoordinatorServer => 1,
             ServerType::TabletServer => 2,
+            ServerType::Unknown => -1,
         }
     }
 
     pub fn from_type_id(type_id: i32) -> Option<ServerType> {
         match type_id {
             1 => Some(ServerType::CoordinatorServer),
             2 => Some(ServerType::TabletServer),
+            -1 => Some(ServerType::Unknown),

Review Comment:
   Aligned this with the Java client behavior. `from_type_id` now returns 
`ServerType::Unknown` for any unrecognized type id instead of `None`, matching 
Java's `ServerType.fromTypeId`. The validation path still fails when the client 
expects a concrete server type and the server advertises `Unknown`.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to