leekeiabstraction commented on code in PR #360:
URL: https://github.com/apache/fluss-rust/pull/360#discussion_r2839745429


##########
crates/fluss/src/client/write/writer_client.rs:
##########
@@ -125,8 +125,12 @@ impl WriterClient {
             if let Some(assigner) = self.bucket_assigners.get(table_path) {
                 assigner.clone()
             } else {
-                let assigner =
-                    Self::create_bucket_assigner(table_info, 
Arc::clone(table_path), bucket_key)?;
+                let assigner = Self::create_bucket_assigner(
+                    table_info,
+                    Arc::clone(table_path),
+                    bucket_key,
+                    &self.config,
+                )?;

Review Comment:
   +1



##########
bindings/cpp/include/fluss.hpp:
##########
@@ -979,6 +979,8 @@ struct Configuration {
     int32_t writer_retries{std::numeric_limits<int32_t>::max()};
     // Writer batch size in bytes (2 MB)
     int32_t writer_batch_size{2 * 1024 * 1024};
+    // Bucket assigner for tables without bucket keys: "sticky" or 
"round_robin"
+    std::string writer_bucket_no_key_assigner{"sticky"};

Review Comment:
   Let's use the same casing as Java side for configuration e.g. `STICKY` or 
`ROUND_ROBIN`https://fluss.apache.org/docs/0.5/maintenance/configuration/



##########
crates/fluss/src/config.rs:
##########
@@ -28,6 +29,26 @@ const DEFAULT_MAX_POLL_RECORDS: usize = 500;
 
 const DEFAULT_ACKS: &str = "all";
 
+/// Bucket assigner strategy for tables without bucket keys.
+/// Matches Java `client.writer.bucket.no-key-assigner`.
+#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum, Deserialize, Serialize)]
+#[serde(rename_all = "snake_case")]
+pub enum BucketAssignerType {

Review Comment:
   Let's be more elaborate on the enum name. BucketAssigner is a very broad 
term which includes HashBucketAssigner. Call this `NoKeyAssigner` like Java 
side?



##########
website/docs/user-guide/python/example/configuration.md:
##########
@@ -21,16 +21,17 @@ with await fluss.FlussConnection.create(config) as conn:
 
 ## Connection Configurations
 
-| Key                 | Description                                           
| Default            |
-|---------------------|-------------------------------------------------------|--------------------|
-| `bootstrap.servers` | Coordinator server address                            
| `127.0.0.1:9123`   |
-| `writer.request-max-size`  | Maximum request size in bytes                  
| `10485760` (10 MB) |
-| `writer.acks`       | Acknowledgment setting (`all` waits for all replicas) 
| `all`              |
-| `writer.retries`    | Number of retries on failure                          
| `2147483647`       |
-| `writer.batch-size` | Batch size for writes in bytes                        
| `2097152` (2 MB)   |
-| `scanner.remote-log.prefetch-num` | Number of remote log segments to 
prefetch | `4`                |
-| `remote-file.download-thread-num` | Number of threads for remote log 
downloads | `3`               |
-| `scanner.log.max-poll-records` | Max records returned in a single poll()     
  | `500`              |
+| Key                                | Description                             
                                             | Default            |
+|------------------------------------|--------------------------------------------------------------------------------------|--------------------|
+| `bootstrap.servers`               | Coordinator server address               
                                             | `127.0.0.1:9123`   |
+| `writer.request-max-size`         | Maximum request size in bytes            
                                             | `10485760` (10 MB) |
+| `writer.acks`                     | Acknowledgment setting (`all` waits for 
all replicas)                                 | `all`              |
+| `writer.retries`                  | Number of retries on failure             
                                             | `2147483647`       |
+| `writer.batch-size`               | Batch size for writes in bytes           
                                             | `2097152` (2 MB)   |
+| `writer.bucket.no-key-assigner`   | Bucket assignment strategy for tables 
without bucket keys: `sticky` or `round_robin`  | `sticky`           |

Review Comment:
   Similar as earlier comment, use same casing as Java side.



##########
website/docs/user-guide/rust/example/configuration.md:
##########
@@ -17,10 +17,11 @@ let conn = FlussConnection::new(config).await?;
 
 ## Connection Configurations
 
-| Option                    | Description                                      
     | Default          |
-|---------------------------|-------------------------------------------------------|------------------|
-| `bootstrap_servers`       | Coordinator server address                       
     | `127.0.0.1:9123` |
-| `writer_request_max_size` | Maximum request size in bytes                    
     | 10 MB            |
-| `writer_acks`             | Acknowledgment setting (`all` waits for all 
replicas) | `all`            |
-| `writer_retries`          | Number of retries on failure                     
     | `i32::MAX`       |
-| `writer_batch_size`       | Batch size for writes                            
     | 2 MB             |
+| Option                          | Description                                
                                 | Default          |
+|---------------------------------|-----------------------------------------------------------------------------|------------------|
+| `bootstrap_servers`             | Coordinator server address                 
                                 | `127.0.0.1:9123` |
+| `writer_request_max_size`       | Maximum request size in bytes              
                                 | 10 MB            |
+| `writer_acks`                   | Acknowledgment setting (`all` waits for 
all replicas)                       | `all`            |
+| `writer_retries`                | Number of retries on failure               
                                 | `i32::MAX`       |
+| `writer_batch_size`             | Batch size for writes                      
                                 | 2 MB             |
+| `writer_bucket_no_key_assigner` | Bucket assignment strategy for tables 
without bucket keys: `sticky` or `round_robin` | `sticky`         |

Review Comment:
   nit: Markdown table indentation / justify



-- 
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