Prajwal-banakar commented on code in PR #449:
URL: https://github.com/apache/fluss-rust/pull/449#discussion_r3025913820
##########
crates/fluss/src/config.rs:
##########
@@ -350,6 +350,39 @@ impl Config {
}
Ok(())
}
+ pub fn validate_numeric_fields(&self) -> Result<(), String> {
+ if self.writer_request_max_size <= 0 {
+ return Err("writer_request_max_size must be > 0".to_string());
+ }
+ if self.writer_batch_size <= 0 {
+ return Err("writer_batch_size must be > 0".to_string());
+ }
+ if self.writer_batch_timeout_ms < 0 {
+ return Err("writer_batch_timeout_ms must be >= 0".to_string());
+ }
+ if self.remote_file_download_thread_num == 0 {
+ return Err("remote_file_download_thread_num must be >
0".to_string());
+ }
+ if self.scanner_remote_log_prefetch_num == 0 {
+ return Err("scanner_remote_log_prefetch_num must be >
0".to_string());
+ }
+ if self.scanner_remote_log_read_concurrency == 0 {
+ return Err("scanner_remote_log_read_concurrency must be >
0".to_string());
+ }
+ if self.scanner_log_max_poll_records == 0 {
+ return Err("scanner_log_max_poll_records must be > 0".to_string());
+ }
+ if self.writer_max_inflight_requests_per_bucket == 0 {
+ return Err("writer_max_inflight_requests_per_bucket must be >
0".to_string());
+ }
+ if self.writer_buffer_memory_size == 0 {
+ return Err("writer_buffer_memory_size must be > 0".to_string());
+ }
+ if self.connect_timeout_ms == 0 {
+ return Err("connect_timeout_ms must be > 0".to_string());
+ }
+ Ok(())
Review Comment:
Added the requested checks in config validation
--
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]