1use foyer::{Compression, LfuConfig, LruConfig, RecoverMode, S3FifoConfig, Throttle};
16use serde::de::Error as _;
17
18use super::*;
19
20#[serde_with::apply(Option => #[serde(with = "none_as_empty_string")])]
22#[derive(Clone, Debug, Serialize, Deserialize, DefaultFromSerde, ConfigDoc)]
23pub struct StorageConfig {
24 #[serde(default = "default::storage::share_buffers_sync_parallelism")]
26 pub share_buffers_sync_parallelism: u32,
27
28 #[serde(default = "default::storage::share_buffer_compaction_worker_threads_number")]
31 pub share_buffer_compaction_worker_threads_number: u32,
32
33 #[serde(default)]
38 pub shared_buffer_capacity_mb: Option<usize>,
39
40 #[serde(default = "default::storage::shared_buffer_flush_ratio")]
43 pub shared_buffer_flush_ratio: f32,
44
45 #[serde(default = "default::storage::shared_buffer_min_batch_flush_size_mb")]
48 pub shared_buffer_min_batch_flush_size_mb: usize,
49
50 #[serde(default = "default::storage::imm_merge_threshold")]
52 #[deprecated]
53 pub imm_merge_threshold: usize,
54
55 #[serde(default = "default::storage::write_conflict_detection_enabled")]
57 pub write_conflict_detection_enabled: bool,
58
59 #[serde(default)]
60 #[config_doc(nested)]
61 pub cache: CacheConfig,
62
63 #[serde(default)]
65 pub block_cache_capacity_mb: Option<usize>,
66
67 #[serde(default)]
69 pub meta_cache_capacity_mb: Option<usize>,
70
71 #[serde(default)]
73 pub high_priority_ratio_in_percent: Option<usize>,
74
75 #[serde(default)]
77 pub prefetch_buffer_capacity_mb: Option<usize>,
78
79 #[serde(default = "default::storage::max_cached_recent_versions_number")]
80 pub max_cached_recent_versions_number: usize,
81
82 #[serde(
84 default = "default::storage::max_prefetch_block_number",
85 deserialize_with = "deserialize_max_prefetch_block_number"
86 )]
87 pub max_prefetch_block_number: usize,
88
89 #[serde(
94 default = "default::storage::sstable_meta_fetch_concurrency",
95 deserialize_with = "deserialize_sstable_meta_fetch_concurrency"
96 )]
97 pub sstable_meta_fetch_concurrency: usize,
98
99 #[serde(default = "default::storage::disable_remote_compactor")]
100 pub disable_remote_compactor: bool,
101
102 #[serde(default = "default::storage::share_buffer_upload_concurrency")]
104 pub share_buffer_upload_concurrency: usize,
105
106 #[serde(default)]
107 pub compactor_memory_limit_mb: Option<usize>,
108
109 #[serde(default = "default::storage::compactor_max_task_multiplier")]
113 pub compactor_max_task_multiplier: f32,
114
115 #[serde(default = "default::storage::compactor_memory_available_proportion")]
118 pub compactor_memory_available_proportion: f64,
119
120 #[serde(default = "default::storage::sstable_id_remote_fetch_number")]
122 pub sstable_id_remote_fetch_number: u32,
123
124 #[serde(default = "default::storage::min_sstable_size_mb")]
125 pub min_sstable_size_mb: u32,
126
127 #[serde(default)]
128 #[config_doc(nested)]
129 pub data_file_cache: FileCacheConfig,
130
131 #[serde(default)]
132 #[config_doc(nested)]
133 pub meta_file_cache: FileCacheConfig,
134
135 #[serde(default = "default::storage::sst_skip_bloom_filter_in_serde")]
139 pub sst_skip_bloom_filter_in_serde: bool,
140
141 #[serde(default)]
142 #[config_doc(nested)]
143 pub cache_refill: CacheRefillConfig,
144
145 #[serde(default = "default::storage::min_sst_size_for_streaming_upload")]
147 pub min_sst_size_for_streaming_upload: u64,
148
149 #[serde(default = "default::storage::max_concurrent_compaction_task_number")]
150 pub max_concurrent_compaction_task_number: u64,
151
152 #[serde(default = "default::storage::max_preload_wait_time_mill")]
153 pub max_preload_wait_time_mill: u64,
154
155 #[serde(default = "default::storage::max_version_pinning_duration_sec")]
156 pub max_version_pinning_duration_sec: u64,
157
158 #[serde(default = "default::storage::compactor_max_sst_key_count")]
159 pub compactor_max_sst_key_count: u64,
160 #[serde(default = "default::storage::compact_iter_recreate_timeout_ms")]
162 pub compact_iter_recreate_timeout_ms: u64,
163 #[serde(default = "default::storage::compactor_max_sst_size")]
164 pub compactor_max_sst_size: u64,
165 #[serde(default = "default::storage::enable_fast_compaction")]
166 pub enable_fast_compaction: bool,
167 #[serde(default = "default::storage::check_compaction_result")]
168 pub check_compaction_result: bool,
169 #[serde(default = "default::storage::max_preload_io_retry_times")]
172 pub max_preload_io_retry_times: usize,
173 #[serde(default = "default::storage::compactor_fast_max_compact_delete_ratio")]
174 pub compactor_fast_max_compact_delete_ratio: u32,
175 #[serde(default = "default::storage::compactor_fast_max_compact_task_size")]
176 pub compactor_fast_max_compact_task_size: u64,
177 #[serde(default = "default::storage::compactor_iter_max_io_retry_times")]
178 pub compactor_iter_max_io_retry_times: usize,
179
180 #[serde(default = "default::storage::shorten_block_meta_key_threshold")]
185 pub shorten_block_meta_key_threshold: Option<usize>,
186
187 #[serde(default = "default::storage::table_info_statistic_history_times")]
189 #[deprecated]
190 pub table_info_statistic_history_times: usize,
191
192 #[serde(default, flatten)]
193 #[config_doc(omitted)]
194 pub unrecognized: Unrecognized<Self>,
195
196 #[serde(default = "default::storage::mem_table_spill_threshold")]
198 pub mem_table_spill_threshold: usize,
199
200 #[serde(default = "default::storage::compactor_concurrent_uploading_sst_count")]
202 pub compactor_concurrent_uploading_sst_count: Option<usize>,
203
204 #[serde(default = "default::storage::compactor_max_overlap_sst_count")]
205 pub compactor_max_overlap_sst_count: usize,
206
207 #[serde(default = "default::storage::compactor_max_preload_meta_file_count")]
211 pub compactor_max_preload_meta_file_count: usize,
212
213 #[serde(default = "default::storage::vector_file_block_size_kb")]
214 pub vector_file_block_size_kb: usize,
215
216 #[serde(default)]
221 pub object_store: ObjectStoreConfig,
222
223 #[serde(default = "default::storage::time_travel_version_cache_capacity")]
224 pub time_travel_version_cache_capacity: u64,
225
226 #[serde(default = "default::storage::table_change_log_cache_capacity")]
227 pub table_change_log_cache_capacity: u64,
228
229 #[serde(default)]
234 pub iceberg_compaction_memory_limit_mb: Option<usize>,
235 #[serde(default = "default::storage::iceberg_compaction_enable_validate")]
236 pub iceberg_compaction_enable_validate: bool,
237 #[serde(default = "default::storage::iceberg_compaction_max_record_batch_rows")]
238 pub iceberg_compaction_max_record_batch_rows: usize,
239 #[serde(default = "default::storage::iceberg_compaction_min_size_per_partition_mb")]
240 pub iceberg_compaction_min_size_per_partition_mb: u32,
241 #[serde(default = "default::storage::iceberg_compaction_max_file_count_per_partition")]
242 pub iceberg_compaction_max_file_count_per_partition: u32,
243 #[serde(default = "default::storage::iceberg_compaction_write_parquet_max_row_group_rows")]
246 #[deprecated(
247 note = "This config is deprecated. Use sink config `compaction.write_parquet_max_row_group_rows` instead."
248 )]
249 pub iceberg_compaction_write_parquet_max_row_group_rows: usize,
250
251 #[serde(default = "default::storage::iceberg_compaction_task_parallelism_ratio")]
254 pub iceberg_compaction_task_parallelism_ratio: f32,
255 #[serde(default = "default::storage::iceberg_compaction_enable_heuristic_output_parallelism")]
257 pub iceberg_compaction_enable_heuristic_output_parallelism: bool,
258 #[serde(default = "default::storage::iceberg_compaction_max_concurrent_closes")]
260 pub iceberg_compaction_max_concurrent_closes: usize,
261 #[serde(default = "default::storage::iceberg_compaction_enable_dynamic_size_estimation")]
263 pub iceberg_compaction_enable_dynamic_size_estimation: bool,
264 #[serde(default = "default::storage::iceberg_compaction_size_estimation_smoothing_factor")]
266 pub iceberg_compaction_size_estimation_smoothing_factor: f64,
267 #[serde(
271 default = "default::storage::iceberg_compaction_pending_parallelism_budget_multiplier"
272 )]
273 pub iceberg_compaction_pending_parallelism_budget_multiplier: f32,
274 #[serde(default = "default::storage::iceberg_compaction_max_pull_task_count")]
276 pub iceberg_compaction_max_pull_task_count: u32,
277 #[serde(
279 default = "default::storage::iceberg_compaction_pull_interval_ms",
280 deserialize_with = "deserialize_iceberg_compaction_pull_interval_ms"
281 )]
282 pub iceberg_compaction_pull_interval_ms: u64,
283 #[serde(default = "default::storage::iceberg_compaction_enable_prefetch")]
295 pub iceberg_compaction_enable_prefetch: bool,
296
297 #[serde(default = "default::storage::iceberg_compaction_target_binpack_group_size_mb")]
298 pub iceberg_compaction_target_binpack_group_size_mb: Option<u64>,
299 #[serde(default = "default::storage::iceberg_compaction_min_group_size_mb")]
300 pub iceberg_compaction_min_group_size_mb: Option<u64>,
301 #[serde(default = "default::storage::iceberg_compaction_min_group_file_count")]
302 pub iceberg_compaction_min_group_file_count: Option<usize>,
303}
304
305#[serde_with::apply(Option => #[serde(with = "none_as_empty_string")])]
307#[derive(Clone, Debug, Serialize, Deserialize, DefaultFromSerde, ConfigDoc)]
308pub struct CacheConfig {
309 #[serde(default)]
314 pub block_cache_capacity_mb: Option<usize>,
315
316 #[serde(default)]
319 pub block_cache_shard_num: Option<usize>,
320
321 #[serde(default)]
322 #[config_doc(omitted)]
323 pub block_cache_eviction: CacheEvictionConfig,
324
325 #[serde(default)]
330 pub meta_cache_capacity_mb: Option<usize>,
331
332 #[serde(default)]
335 pub meta_cache_shard_num: Option<usize>,
336
337 #[serde(default)]
338 #[config_doc(omitted)]
339 pub meta_cache_eviction: CacheEvictionConfig,
340
341 #[serde(default = "default::storage::vector_block_cache_capacity_mb")]
342 pub vector_block_cache_capacity_mb: usize,
343 #[serde(default = "default::storage::vector_block_cache_shard_num")]
344 pub vector_block_cache_shard_num: usize,
345 #[serde(default)]
346 #[config_doc(omitted)]
347 pub vector_block_cache_eviction_config: CacheEvictionConfig,
348 #[serde(default = "default::storage::vector_meta_cache_capacity_mb")]
349 pub vector_meta_cache_capacity_mb: usize,
350 #[serde(default = "default::storage::vector_meta_cache_shard_num")]
351 pub vector_meta_cache_shard_num: usize,
352 #[serde(default)]
353 #[config_doc(omitted)]
354 pub vector_meta_cache_eviction_config: CacheEvictionConfig,
355}
356
357#[derive(Clone, Debug, Serialize, Deserialize)]
359#[serde(tag = "algorithm")]
360pub enum CacheEvictionConfig {
361 Lru {
362 high_priority_ratio_in_percent: Option<usize>,
363 },
364 Lfu {
365 window_capacity_ratio_in_percent: Option<usize>,
366 protected_capacity_ratio_in_percent: Option<usize>,
367 cmsketch_eps: Option<f64>,
368 cmsketch_confidence: Option<f64>,
369 },
370 S3Fifo {
371 small_queue_capacity_ratio_in_percent: Option<usize>,
372 ghost_queue_capacity_ratio_in_percent: Option<usize>,
373 small_to_main_freq_threshold: Option<u8>,
374 },
375}
376
377impl Default for CacheEvictionConfig {
378 fn default() -> Self {
379 Self::Lru {
380 high_priority_ratio_in_percent: None,
381 }
382 }
383}
384
385#[serde_with::apply(Option => #[serde(with = "none_as_empty_string")])]
386#[derive(Clone, Debug, Serialize, Deserialize, DefaultFromSerde, ConfigDoc)]
387pub struct CacheRefillConfig {
388 #[serde(default = "default::cache_refill::meta_refill_concurrency")]
392 pub meta_refill_concurrency: usize,
393
394 #[serde(default = "default::cache_refill::data_refill_levels")]
396 pub data_refill_levels: Vec<u32>,
397
398 #[serde(default = "default::cache_refill::timeout_ms")]
400 pub timeout_ms: u64,
401
402 #[serde(default = "default::cache_refill::concurrency")]
404 pub concurrency: usize,
405
406 #[serde(default = "default::cache_refill::unit")]
408 pub unit: usize,
409
410 #[serde(default = "default::cache_refill::threshold")]
414 pub threshold: f64,
415
416 #[serde(default = "default::cache_refill::recent_filter_shards")]
418 pub recent_filter_shards: usize,
419
420 #[serde(default = "default::cache_refill::recent_filter_layers")]
422 pub recent_filter_layers: usize,
423
424 #[serde(default = "default::cache_refill::recent_filter_rotate_interval_ms")]
426 pub recent_filter_rotate_interval_ms: usize,
427
428 #[serde(default = "default::cache_refill::skip_recent_filter")]
432 pub skip_recent_filter: bool,
433
434 #[serde(default = "default::cache_refill::skip_inheritance_filter")]
441 pub skip_inheritance_filter: bool,
442
443 #[serde(default, flatten)]
444 #[config_doc(omitted)]
445 pub unrecognized: Unrecognized<Self>,
446}
447
448#[derive(Clone, Debug, Default, Serialize, Deserialize)]
449pub struct FileCacheTokioRuntimeConfig {
450 pub worker_threads: usize,
452
453 pub max_blocking_threads: usize,
455}
456
457#[derive(Clone, Debug, Serialize, Deserialize)]
458pub enum FileCacheRuntimeConfig {
459 Disabled,
461 Unified(FileCacheTokioRuntimeConfig),
463 Separated {
467 read_runtime_options: FileCacheTokioRuntimeConfig,
468 write_runtime_options: FileCacheTokioRuntimeConfig,
469 },
470}
471
472#[serde_with::apply(Option => #[serde(with = "none_as_empty_string")])]
476#[derive(Clone, Debug, Serialize, Deserialize, DefaultFromSerde, ConfigDoc)]
477pub struct FileCacheConfig {
478 #[serde(default = "default::file_cache::dir")]
479 pub dir: String,
480
481 #[serde(default = "default::file_cache::direct_io")]
483 pub direct_io: bool,
484
485 #[serde(default = "default::file_cache::capacity_mb")]
486 pub capacity_mb: usize,
487
488 #[serde(default = "default::file_cache::file_capacity_mb")]
489 pub file_capacity_mb: usize,
490
491 #[serde(default = "default::file_cache::flushers")]
492 pub flushers: usize,
493
494 #[serde(default = "default::file_cache::reclaimers")]
495 pub reclaimers: usize,
496
497 #[serde(default = "default::file_cache::recover_concurrency")]
498 pub recover_concurrency: usize,
499
500 #[serde(default = "default::file_cache::insert_rate_limit_mb")]
502 pub insert_rate_limit_mb: usize,
503
504 #[serde(default = "default::file_cache::indexer_shards")]
505 pub indexer_shards: usize,
506
507 #[serde(default = "default::file_cache::compression")]
508 pub compression: Compression,
509
510 #[serde(default = "default::file_cache::flush_buffer_threshold_mb")]
511 pub flush_buffer_threshold_mb: Option<usize>,
512
513 #[serde(default = "default::file_cache::submit_queue_size_threshold_mb")]
516 pub submit_queue_size_threshold_mb: usize,
517
518 #[serde(default = "default::file_cache::throttle")]
519 pub throttle: Throttle,
520
521 #[serde(default = "default::file_cache::fifo_probation_ratio")]
522 pub fifo_probation_ratio: f64,
523
524 #[serde(default = "default::file_cache::blob_index_size_kb")]
536 pub blob_index_size_kb: usize,
537
538 #[serde(default = "default::file_cache::recover_mode")]
548 pub recover_mode: RecoverMode,
549
550 #[serde(default = "default::file_cache::runtime_config")]
551 pub runtime_config: FileCacheRuntimeConfig,
552
553 #[serde(default, flatten)]
554 #[config_doc(omitted)]
555 pub unrecognized: Unrecognized<Self>,
556}
557
558#[serde_with::apply(Option => #[serde(with = "none_as_empty_string")])]
560#[derive(Clone, Debug, Serialize, Deserialize, DefaultFromSerde)]
561pub struct ObjectStoreConfig {
562 #[serde(
564 default = "default::object_store_config::set_atomic_write_dir",
565 alias = "object_store_set_atomic_write_dir"
566 )]
567 pub set_atomic_write_dir: bool,
568
569 #[serde(default)]
573 pub retry: ObjectStoreRetryConfig,
574
575 #[serde(default)]
577 pub s3: S3ObjectStoreConfig,
578
579 #[serde(default = "default::object_store_config::object_store_req_concurrency_limit")]
584 pub req_concurrency_limit: usize,
585
586 #[serde(default = "default::object_store_config::http_concurrent_limit")]
589 pub http_concurrent_limit: usize,
590
591 #[serde(default)]
596 pub opendal_streaming_read_chunk_size: usize,
597
598 #[serde(default = "default::object_store_config::opendal_streaming_read_chunk_concurrency")]
601 pub opendal_streaming_read_chunk_concurrency: usize,
602
603 #[serde(default = "default::object_store_config::opendal_upload_concurrency")]
605 pub opendal_upload_concurrency: usize,
606
607 #[serde(default)]
609 pub opendal_writer_abort_on_err: bool,
610
611 #[serde(default = "default::object_store_config::upload_part_size")]
612 pub upload_part_size: usize,
613}
614
615fn deserialize_sstable_meta_fetch_concurrency<'de, D>(deserializer: D) -> Result<usize, D::Error>
616where
617 D: serde::Deserializer<'de>,
618{
619 let value = usize::deserialize(deserializer)?;
620 if value == 0 {
621 return Err(D::Error::custom(
622 "storage.sstable_meta_fetch_concurrency must be greater than 0",
623 ));
624 }
625 Ok(value)
626}
627
628fn deserialize_max_prefetch_block_number<'de, D>(deserializer: D) -> Result<usize, D::Error>
629where
630 D: serde::Deserializer<'de>,
631{
632 let value = usize::deserialize(deserializer)?;
633 if value == 0 {
634 return Err(D::Error::custom(
635 "storage.max_prefetch_block_number must be greater than 0",
636 ));
637 }
638 Ok(value)
639}
640
641fn deserialize_iceberg_compaction_pull_interval_ms<'de, D>(deserializer: D) -> Result<u64, D::Error>
642where
643 D: serde::Deserializer<'de>,
644{
645 let value = u64::deserialize(deserializer)?;
646 if value == 0 {
647 return Err(D::Error::custom(
648 "storage.iceberg_compaction_pull_interval_ms must be greater than 0",
649 ));
650 }
651 Ok(value)
652}
653
654fn deserialize_http_client_rotation_interval_ms<'de, D>(
655 deserializer: D,
656) -> Result<Option<u64>, D::Error>
657where
658 D: serde::Deserializer<'de>,
659{
660 let value = none_as_empty_string::deserialize(deserializer)?;
661 if value == Some(0) {
662 return Err(D::Error::custom(
663 "storage.object_store.s3.http_client_rotation_interval_ms must be greater than 0",
664 ));
665 }
666 Ok(value)
667}
668
669impl ObjectStoreConfig {
670 pub fn set_atomic_write_dir(&mut self) {
671 self.set_atomic_write_dir = true;
672 }
673}
674
675#[serde_with::apply(Option => #[serde(with = "none_as_empty_string")])]
677#[derive(Clone, Debug, Serialize, Deserialize, DefaultFromSerde)]
678pub struct S3ObjectStoreConfig {
679 #[serde(
681 default = "default::object_store_config::s3::keepalive_ms",
682 alias = "object_store_keepalive_ms"
683 )]
684 pub keepalive_ms: Option<u64>,
685 #[serde_with(skip_apply)]
691 #[serde(
692 default,
693 serialize_with = "none_as_empty_string::serialize",
694 deserialize_with = "deserialize_http_client_rotation_interval_ms"
695 )]
696 pub http_client_rotation_interval_ms: Option<u64>,
697 #[serde(
698 default = "default::object_store_config::s3::recv_buffer_size",
699 alias = "object_store_recv_buffer_size"
700 )]
701 pub recv_buffer_size: Option<usize>,
702 #[serde(
703 default = "default::object_store_config::s3::send_buffer_size",
704 alias = "object_store_send_buffer_size"
705 )]
706 pub send_buffer_size: Option<usize>,
707 #[serde(
708 default = "default::object_store_config::s3::nodelay",
709 alias = "object_store_nodelay"
710 )]
711 pub nodelay: Option<bool>,
712 #[serde(default = "default::object_store_config::s3::developer::retry_unknown_service_error")]
714 pub retry_unknown_service_error: bool,
715 #[serde(default = "default::object_store_config::s3::identity_resolution_timeout_s")]
716 pub identity_resolution_timeout_s: u64,
717 #[serde(default)]
718 pub developer: S3ObjectStoreDeveloperConfig,
719}
720
721#[serde_with::apply(Option => #[serde(with = "none_as_empty_string")])]
723#[derive(Clone, Debug, Serialize, Deserialize, DefaultFromSerde)]
724pub struct S3ObjectStoreDeveloperConfig {
725 #[serde(
727 default = "default::object_store_config::s3::developer::retry_unknown_service_error",
728 alias = "object_store_retry_unknown_service_error"
729 )]
730 pub retry_unknown_service_error: bool,
731 #[serde(
734 default = "default::object_store_config::s3::developer::retryable_service_error_codes",
735 alias = "object_store_retryable_service_error_codes"
736 )]
737 pub retryable_service_error_codes: Vec<String>,
738
739 #[serde(default = "default::object_store_config::s3::developer::use_opendal")]
741 pub use_opendal: bool,
742}
743
744#[serde_with::apply(Option => #[serde(with = "none_as_empty_string")])]
745#[derive(Clone, Debug, Serialize, Deserialize, DefaultFromSerde)]
746pub struct ObjectStoreRetryConfig {
747 #[serde(default = "default::object_store_config::object_store_req_backoff_interval_ms")]
751 pub req_backoff_interval_ms: u64,
752
753 #[serde(default = "default::object_store_config::object_store_req_backoff_max_delay_ms")]
755 pub req_backoff_max_delay_ms: u64,
756
757 #[serde(default = "default::object_store_config::object_store_req_backoff_factor")]
759 pub req_backoff_factor: u64,
760
761 #[serde(default = "default::object_store_config::object_store_upload_attempt_timeout_ms")]
763 pub upload_attempt_timeout_ms: u64,
764
765 #[serde(default = "default::object_store_config::object_store_upload_retry_attempts")]
767 pub upload_retry_attempts: usize,
768
769 #[serde(
771 default = "default::object_store_config::object_store_streaming_upload_attempt_timeout_ms"
772 )]
773 pub streaming_upload_attempt_timeout_ms: u64,
774
775 #[serde(
777 default = "default::object_store_config::object_store_streaming_upload_retry_attempts"
778 )]
779 pub streaming_upload_retry_attempts: usize,
780
781 #[serde(default = "default::object_store_config::object_store_read_attempt_timeout_ms")]
783 pub read_attempt_timeout_ms: u64,
784
785 #[serde(default = "default::object_store_config::object_store_read_retry_attempts")]
787 pub read_retry_attempts: usize,
788
789 #[serde(
791 default = "default::object_store_config::object_store_streaming_read_attempt_timeout_ms"
792 )]
793 pub streaming_read_attempt_timeout_ms: u64,
794
795 #[serde(default = "default::object_store_config::object_store_streaming_read_retry_attempts")]
797 pub streaming_read_retry_attempts: usize,
798
799 #[serde(default = "default::object_store_config::object_store_metadata_attempt_timeout_ms")]
801 pub metadata_attempt_timeout_ms: u64,
802
803 #[serde(default = "default::object_store_config::object_store_metadata_retry_attempts")]
805 pub metadata_retry_attempts: usize,
806
807 #[serde(default = "default::object_store_config::object_store_delete_attempt_timeout_ms")]
809 pub delete_attempt_timeout_ms: u64,
810
811 #[serde(default = "default::object_store_config::object_store_delete_retry_attempts")]
813 pub delete_retry_attempts: usize,
814
815 #[serde(
817 default = "default::object_store_config::object_store_delete_objects_attempt_timeout_ms"
818 )]
819 pub delete_objects_attempt_timeout_ms: u64,
820
821 #[serde(default = "default::object_store_config::object_store_delete_objects_retry_attempts")]
823 pub delete_objects_retry_attempts: usize,
824
825 #[serde(default = "default::object_store_config::object_store_list_attempt_timeout_ms")]
827 pub list_attempt_timeout_ms: u64,
828
829 #[serde(default = "default::object_store_config::object_store_list_retry_attempts")]
831 pub list_retry_attempts: usize,
832}
833
834#[derive(Debug, Clone)]
835pub enum EvictionConfig {
836 Lru(LruConfig),
837 Lfu(LfuConfig),
838 S3Fifo(S3FifoConfig),
839}
840
841impl EvictionConfig {
842 pub fn for_test() -> Self {
843 Self::Lru(LruConfig {
844 high_priority_pool_ratio: 0.0,
845 })
846 }
847}
848
849impl From<EvictionConfig> for foyer::EvictionConfig {
850 fn from(value: EvictionConfig) -> Self {
851 match value {
852 EvictionConfig::Lru(lru) => foyer::EvictionConfig::Lru(lru),
853 EvictionConfig::Lfu(lfu) => foyer::EvictionConfig::Lfu(lfu),
854 EvictionConfig::S3Fifo(s3fifo) => foyer::EvictionConfig::S3Fifo(s3fifo),
855 }
856 }
857}
858
859pub struct StorageMemoryConfig {
860 pub block_cache_capacity_mb: usize,
861 pub block_cache_shard_num: usize,
862 pub meta_cache_capacity_mb: usize,
863 pub meta_cache_shard_num: usize,
864 pub vector_block_cache_capacity_mb: usize,
865 pub vector_block_cache_shard_num: usize,
866 pub vector_meta_cache_capacity_mb: usize,
867 pub vector_meta_cache_shard_num: usize,
868 pub shared_buffer_capacity_mb: usize,
869 pub compactor_memory_limit_mb: usize,
870 pub prefetch_buffer_capacity_mb: usize,
871 pub block_cache_eviction_config: EvictionConfig,
872 pub meta_cache_eviction_config: EvictionConfig,
873 pub vector_block_cache_eviction_config: EvictionConfig,
874 pub vector_meta_cache_eviction_config: EvictionConfig,
875 pub block_file_cache_flush_buffer_threshold_mb: usize,
876 pub meta_file_cache_flush_buffer_threshold_mb: usize,
877}
878
879pub fn extract_storage_memory_config(s: &RwConfig) -> StorageMemoryConfig {
880 let block_cache_capacity_mb = s.storage.cache.block_cache_capacity_mb.unwrap_or(
881 s.storage
883 .block_cache_capacity_mb
884 .unwrap_or(default::storage::block_cache_capacity_mb()),
885 );
886 let meta_cache_capacity_mb = s.storage.cache.meta_cache_capacity_mb.unwrap_or(
887 s.storage
889 .block_cache_capacity_mb
890 .unwrap_or(default::storage::meta_cache_capacity_mb()),
891 );
892 let shared_buffer_capacity_mb = s
893 .storage
894 .shared_buffer_capacity_mb
895 .unwrap_or(default::storage::shared_buffer_capacity_mb());
896 let meta_cache_shard_num = s.storage.cache.meta_cache_shard_num.unwrap_or_else(|| {
897 let mut shard_bits = MAX_META_CACHE_SHARD_BITS;
898 while (meta_cache_capacity_mb >> shard_bits) < MIN_BUFFER_SIZE_PER_SHARD && shard_bits > 0 {
899 shard_bits -= 1;
900 }
901 shard_bits
902 });
903 let block_cache_shard_num = s.storage.cache.block_cache_shard_num.unwrap_or_else(|| {
904 let mut shard_bits = MAX_BLOCK_CACHE_SHARD_BITS;
905 while (block_cache_capacity_mb >> shard_bits) < MIN_BUFFER_SIZE_PER_SHARD && shard_bits > 0
906 {
907 shard_bits -= 1;
908 }
909 shard_bits
910 });
911 let compactor_memory_limit_mb = s
912 .storage
913 .compactor_memory_limit_mb
914 .unwrap_or(default::storage::compactor_memory_limit_mb());
915
916 let get_eviction_config = |c: &CacheEvictionConfig| {
917 match c {
918 CacheEvictionConfig::Lru {
919 high_priority_ratio_in_percent,
920 } => EvictionConfig::Lru(LruConfig {
921 high_priority_pool_ratio: high_priority_ratio_in_percent.unwrap_or(
922 s.storage
924 .high_priority_ratio_in_percent
925 .unwrap_or(default::storage::high_priority_ratio_in_percent()),
926 ) as f64
927 / 100.0,
928 }),
929 CacheEvictionConfig::Lfu {
930 window_capacity_ratio_in_percent,
931 protected_capacity_ratio_in_percent,
932 cmsketch_eps,
933 cmsketch_confidence,
934 } => EvictionConfig::Lfu(LfuConfig {
935 window_capacity_ratio: window_capacity_ratio_in_percent
936 .unwrap_or(default::storage::window_capacity_ratio_in_percent())
937 as f64
938 / 100.0,
939 protected_capacity_ratio: protected_capacity_ratio_in_percent
940 .unwrap_or(default::storage::protected_capacity_ratio_in_percent())
941 as f64
942 / 100.0,
943 cmsketch_eps: cmsketch_eps.unwrap_or(default::storage::cmsketch_eps()),
944 cmsketch_confidence: cmsketch_confidence
945 .unwrap_or(default::storage::cmsketch_confidence()),
946 }),
947 CacheEvictionConfig::S3Fifo {
948 small_queue_capacity_ratio_in_percent,
949 ghost_queue_capacity_ratio_in_percent,
950 small_to_main_freq_threshold,
951 } => EvictionConfig::S3Fifo(S3FifoConfig {
952 small_queue_capacity_ratio: small_queue_capacity_ratio_in_percent
953 .unwrap_or(default::storage::small_queue_capacity_ratio_in_percent())
954 as f64
955 / 100.0,
956 ghost_queue_capacity_ratio: ghost_queue_capacity_ratio_in_percent
957 .unwrap_or(default::storage::ghost_queue_capacity_ratio_in_percent())
958 as f64
959 / 100.0,
960 small_to_main_freq_threshold: small_to_main_freq_threshold
961 .unwrap_or(default::storage::small_to_main_freq_threshold()),
962 }),
963 }
964 };
965
966 let block_cache_eviction_config = get_eviction_config(&s.storage.cache.block_cache_eviction);
967 let meta_cache_eviction_config = get_eviction_config(&s.storage.cache.meta_cache_eviction);
968 let vector_block_cache_eviction_config =
969 get_eviction_config(&s.storage.cache.vector_block_cache_eviction_config);
970 let vector_meta_cache_eviction_config =
971 get_eviction_config(&s.storage.cache.vector_meta_cache_eviction_config);
972
973 let prefetch_buffer_capacity_mb =
974 s.storage
975 .shared_buffer_capacity_mb
976 .unwrap_or(match &block_cache_eviction_config {
977 EvictionConfig::Lru(lru) => {
978 ((1.0 - lru.high_priority_pool_ratio) * block_cache_capacity_mb as f64) as usize
979 }
980 EvictionConfig::Lfu(lfu) => {
981 ((1.0 - lfu.protected_capacity_ratio) * block_cache_capacity_mb as f64) as usize
982 }
983 EvictionConfig::S3Fifo(s3fifo) => {
984 (s3fifo.small_queue_capacity_ratio * block_cache_capacity_mb as f64) as usize
985 }
986 });
987
988 let block_file_cache_flush_buffer_threshold_mb = s
989 .storage
990 .data_file_cache
991 .flush_buffer_threshold_mb
992 .unwrap_or(default::storage::block_file_cache_flush_buffer_threshold_mb());
993 let meta_file_cache_flush_buffer_threshold_mb = s
994 .storage
995 .meta_file_cache
996 .flush_buffer_threshold_mb
997 .unwrap_or(default::storage::meta_file_cache_flush_buffer_threshold_mb());
998
999 StorageMemoryConfig {
1000 block_cache_capacity_mb,
1001 block_cache_shard_num,
1002 meta_cache_capacity_mb,
1003 meta_cache_shard_num,
1004 vector_block_cache_capacity_mb: s.storage.cache.vector_block_cache_capacity_mb,
1005 vector_block_cache_shard_num: s.storage.cache.vector_block_cache_shard_num,
1006 vector_meta_cache_capacity_mb: s.storage.cache.vector_meta_cache_capacity_mb,
1007 vector_meta_cache_shard_num: s.storage.cache.vector_meta_cache_shard_num,
1008 shared_buffer_capacity_mb,
1009 compactor_memory_limit_mb,
1010 prefetch_buffer_capacity_mb,
1011 block_cache_eviction_config,
1012 meta_cache_eviction_config,
1013 vector_block_cache_eviction_config,
1014 vector_meta_cache_eviction_config,
1015 block_file_cache_flush_buffer_threshold_mb,
1016 meta_file_cache_flush_buffer_threshold_mb,
1017 }
1018}
1019
1020pub mod default {
1021
1022 pub mod storage {
1023 pub fn share_buffers_sync_parallelism() -> u32 {
1024 1
1025 }
1026
1027 pub fn share_buffer_compaction_worker_threads_number() -> u32 {
1028 4
1029 }
1030
1031 pub fn shared_buffer_capacity_mb() -> usize {
1032 1024
1033 }
1034
1035 pub fn shared_buffer_flush_ratio() -> f32 {
1036 0.8
1037 }
1038
1039 pub fn shared_buffer_min_batch_flush_size_mb() -> usize {
1040 800
1041 }
1042
1043 pub fn imm_merge_threshold() -> usize {
1044 0 }
1046
1047 pub fn write_conflict_detection_enabled() -> bool {
1048 cfg!(debug_assertions)
1049 }
1050
1051 pub fn max_cached_recent_versions_number() -> usize {
1052 60
1053 }
1054
1055 pub fn block_cache_capacity_mb() -> usize {
1056 512
1057 }
1058
1059 pub fn high_priority_ratio_in_percent() -> usize {
1060 70
1061 }
1062
1063 pub fn window_capacity_ratio_in_percent() -> usize {
1064 10
1065 }
1066
1067 pub fn protected_capacity_ratio_in_percent() -> usize {
1068 80
1069 }
1070
1071 pub fn cmsketch_eps() -> f64 {
1072 0.002
1073 }
1074
1075 pub fn cmsketch_confidence() -> f64 {
1076 0.95
1077 }
1078
1079 pub fn small_queue_capacity_ratio_in_percent() -> usize {
1080 10
1081 }
1082
1083 pub fn ghost_queue_capacity_ratio_in_percent() -> usize {
1084 1000
1085 }
1086
1087 pub fn small_to_main_freq_threshold() -> u8 {
1088 1
1089 }
1090
1091 pub fn meta_cache_capacity_mb() -> usize {
1092 128
1093 }
1094
1095 pub fn disable_remote_compactor() -> bool {
1096 false
1097 }
1098
1099 pub fn share_buffer_upload_concurrency() -> usize {
1100 8
1101 }
1102
1103 pub fn compactor_memory_limit_mb() -> usize {
1104 512
1105 }
1106
1107 pub fn compactor_max_task_multiplier() -> f32 {
1108 3.0
1109 }
1110
1111 pub fn compactor_memory_available_proportion() -> f64 {
1112 0.8
1113 }
1114
1115 pub fn sstable_id_remote_fetch_number() -> u32 {
1116 10
1117 }
1118
1119 pub fn min_sstable_size_mb() -> u32 {
1120 32
1121 }
1122
1123 pub fn min_sst_size_for_streaming_upload() -> u64 {
1124 32 * 1024 * 1024
1126 }
1127
1128 pub fn max_concurrent_compaction_task_number() -> u64 {
1129 16
1130 }
1131
1132 pub fn max_preload_wait_time_mill() -> u64 {
1133 0
1134 }
1135
1136 pub fn max_version_pinning_duration_sec() -> u64 {
1137 3 * 3600
1138 }
1139
1140 pub fn compactor_max_sst_key_count() -> u64 {
1141 2 * 1024 * 1024 }
1143
1144 pub fn compact_iter_recreate_timeout_ms() -> u64 {
1145 10 * 60 * 1000
1146 }
1147
1148 pub fn compactor_iter_max_io_retry_times() -> usize {
1149 8
1150 }
1151
1152 pub fn shorten_block_meta_key_threshold() -> Option<usize> {
1153 None
1154 }
1155
1156 pub fn compactor_max_sst_size() -> u64 {
1157 512 * 1024 * 1024 }
1159
1160 pub fn enable_fast_compaction() -> bool {
1161 true
1162 }
1163
1164 pub fn check_compaction_result() -> bool {
1165 false
1166 }
1167
1168 pub fn max_preload_io_retry_times() -> usize {
1169 3
1170 }
1171
1172 pub fn mem_table_spill_threshold() -> usize {
1173 4 << 20
1174 }
1175
1176 pub fn compactor_fast_max_compact_delete_ratio() -> u32 {
1177 40
1178 }
1179
1180 pub fn compactor_fast_max_compact_task_size() -> u64 {
1181 2 * 1024 * 1024 * 1024 }
1183
1184 pub fn sstable_meta_fetch_concurrency() -> usize {
1185 1
1186 }
1187
1188 pub fn max_prefetch_block_number() -> usize {
1189 16
1190 }
1191
1192 pub fn compactor_concurrent_uploading_sst_count() -> Option<usize> {
1193 None
1194 }
1195
1196 pub fn compactor_max_overlap_sst_count() -> usize {
1197 64
1198 }
1199
1200 pub fn compactor_max_preload_meta_file_count() -> usize {
1201 32
1202 }
1203
1204 pub fn vector_file_block_size_kb() -> usize {
1205 1024
1206 }
1207
1208 pub fn vector_block_cache_capacity_mb() -> usize {
1209 16
1210 }
1211
1212 pub fn vector_block_cache_shard_num() -> usize {
1213 16
1214 }
1215
1216 pub fn vector_meta_cache_capacity_mb() -> usize {
1217 16
1218 }
1219
1220 pub fn vector_meta_cache_shard_num() -> usize {
1221 16
1222 }
1223
1224 pub fn table_info_statistic_history_times() -> usize {
1226 240
1227 }
1228
1229 pub fn block_file_cache_flush_buffer_threshold_mb() -> usize {
1230 256
1231 }
1232
1233 pub fn meta_file_cache_flush_buffer_threshold_mb() -> usize {
1234 256
1235 }
1236
1237 pub fn time_travel_version_cache_capacity() -> u64 {
1238 10
1239 }
1240
1241 pub fn table_change_log_cache_capacity() -> u64 {
1242 60
1243 }
1244
1245 pub fn sst_skip_bloom_filter_in_serde() -> bool {
1246 false
1247 }
1248
1249 pub fn iceberg_compaction_enable_validate() -> bool {
1250 false
1251 }
1252
1253 pub fn iceberg_compaction_max_record_batch_rows() -> usize {
1254 1024
1255 }
1256
1257 pub fn iceberg_compaction_write_parquet_max_row_group_rows() -> usize {
1258 1024 * 100 }
1260
1261 pub fn iceberg_compaction_min_size_per_partition_mb() -> u32 {
1262 1024
1263 }
1264
1265 pub fn iceberg_compaction_max_file_count_per_partition() -> u32 {
1266 32
1267 }
1268
1269 pub fn iceberg_compaction_task_parallelism_ratio() -> f32 {
1270 4.0
1271 }
1272
1273 pub fn iceberg_compaction_enable_heuristic_output_parallelism() -> bool {
1274 false
1275 }
1276
1277 pub fn iceberg_compaction_max_concurrent_closes() -> usize {
1278 8
1279 }
1280
1281 pub fn iceberg_compaction_enable_dynamic_size_estimation() -> bool {
1282 true
1283 }
1284
1285 pub fn iceberg_compaction_size_estimation_smoothing_factor() -> f64 {
1286 0.3
1287 }
1288
1289 pub fn iceberg_compaction_pending_parallelism_budget_multiplier() -> f32 {
1290 4.0
1291 }
1292
1293 pub fn iceberg_compaction_max_pull_task_count() -> u32 {
1294 1
1295 }
1296
1297 pub fn iceberg_compaction_pull_interval_ms() -> u64 {
1298 5000
1299 }
1300
1301 pub fn iceberg_compaction_enable_prefetch() -> bool {
1302 false
1303 }
1304
1305 pub fn iceberg_compaction_target_binpack_group_size_mb() -> Option<u64> {
1306 Some(100 * 1024) }
1308
1309 pub fn iceberg_compaction_min_group_size_mb() -> Option<u64> {
1310 None
1311 }
1312
1313 pub fn iceberg_compaction_min_group_file_count() -> Option<usize> {
1314 None
1315 }
1316 }
1317
1318 pub mod file_cache {
1319 use std::num::NonZeroUsize;
1320
1321 use foyer::{Compression, RecoverMode, Throttle};
1322
1323 use super::super::{FileCacheRuntimeConfig, FileCacheTokioRuntimeConfig};
1324
1325 pub fn dir() -> String {
1326 "".to_owned()
1327 }
1328
1329 pub fn direct_io() -> bool {
1330 false
1331 }
1332
1333 pub fn capacity_mb() -> usize {
1334 1024
1335 }
1336
1337 pub fn file_capacity_mb() -> usize {
1338 64
1339 }
1340
1341 pub fn flushers() -> usize {
1342 4
1343 }
1344
1345 pub fn reclaimers() -> usize {
1346 4
1347 }
1348
1349 pub fn recover_concurrency() -> usize {
1350 8
1351 }
1352
1353 pub fn insert_rate_limit_mb() -> usize {
1354 0
1355 }
1356
1357 pub fn indexer_shards() -> usize {
1358 64
1359 }
1360
1361 pub fn compression() -> Compression {
1362 Compression::None
1363 }
1364
1365 pub fn flush_buffer_threshold_mb() -> Option<usize> {
1366 None
1367 }
1368
1369 pub fn submit_queue_size_threshold_mb() -> usize {
1370 16
1371 }
1372
1373 pub fn fifo_probation_ratio() -> f64 {
1374 0.1
1375 }
1376
1377 pub fn blob_index_size_kb() -> usize {
1378 16
1379 }
1380
1381 pub fn recover_mode() -> RecoverMode {
1382 RecoverMode::Quiet
1383 }
1384
1385 pub fn runtime_config() -> FileCacheRuntimeConfig {
1386 FileCacheRuntimeConfig::Unified(FileCacheTokioRuntimeConfig::default())
1387 }
1388
1389 pub fn throttle() -> Throttle {
1390 Throttle::new()
1391 .with_iops_counter(foyer::IopsCounter::PerIoSize(
1392 NonZeroUsize::new(128 * 1024).unwrap(),
1393 ))
1394 .with_read_iops(100000)
1395 .with_write_iops(100000)
1396 .with_write_throughput(1024 * 1024 * 1024)
1397 .with_read_throughput(1024 * 1024 * 1024)
1398 }
1399 }
1400
1401 pub mod cache_refill {
1402 pub fn meta_refill_concurrency() -> usize {
1403 0
1404 }
1405
1406 pub fn data_refill_levels() -> Vec<u32> {
1407 vec![]
1408 }
1409
1410 pub fn timeout_ms() -> u64 {
1411 6000
1412 }
1413
1414 pub fn concurrency() -> usize {
1415 10
1416 }
1417
1418 pub fn unit() -> usize {
1419 64
1420 }
1421
1422 pub fn threshold() -> f64 {
1423 0.5
1424 }
1425
1426 pub fn recent_filter_shards() -> usize {
1427 16
1428 }
1429
1430 pub fn recent_filter_layers() -> usize {
1431 6
1432 }
1433
1434 pub fn recent_filter_rotate_interval_ms() -> usize {
1435 10000
1436 }
1437
1438 pub fn skip_recent_filter() -> bool {
1439 false
1440 }
1441
1442 pub fn skip_inheritance_filter() -> bool {
1443 false
1444 }
1445 }
1446
1447 pub mod object_store_config {
1448 const DEFAULT_REQ_BACKOFF_INTERVAL_MS: u64 = 1000; const DEFAULT_REQ_BACKOFF_MAX_DELAY_MS: u64 = 10 * 1000; const DEFAULT_REQ_MAX_RETRY_ATTEMPTS: usize = 3;
1451
1452 pub fn opendal_streaming_read_chunk_concurrency() -> usize {
1453 1
1454 }
1455
1456 pub fn set_atomic_write_dir() -> bool {
1457 false
1458 }
1459
1460 pub fn object_store_req_concurrency_limit() -> usize {
1461 0
1462 }
1463
1464 pub fn http_concurrent_limit() -> usize {
1465 0
1466 }
1467
1468 pub fn object_store_req_backoff_interval_ms() -> u64 {
1469 DEFAULT_REQ_BACKOFF_INTERVAL_MS
1470 }
1471
1472 pub fn object_store_req_backoff_max_delay_ms() -> u64 {
1473 DEFAULT_REQ_BACKOFF_MAX_DELAY_MS }
1475
1476 pub fn object_store_req_backoff_factor() -> u64 {
1477 2
1478 }
1479
1480 pub fn object_store_upload_attempt_timeout_ms() -> u64 {
1481 8 * 1000 }
1483
1484 pub fn object_store_upload_retry_attempts() -> usize {
1485 DEFAULT_REQ_MAX_RETRY_ATTEMPTS
1486 }
1487
1488 pub fn object_store_streaming_upload_attempt_timeout_ms() -> u64 {
1490 5 * 1000 }
1492
1493 pub fn object_store_streaming_upload_retry_attempts() -> usize {
1494 DEFAULT_REQ_MAX_RETRY_ATTEMPTS
1495 }
1496
1497 pub fn object_store_read_attempt_timeout_ms() -> u64 {
1499 8 * 1000 }
1501
1502 pub fn object_store_read_retry_attempts() -> usize {
1503 DEFAULT_REQ_MAX_RETRY_ATTEMPTS
1504 }
1505
1506 pub fn object_store_streaming_read_attempt_timeout_ms() -> u64 {
1507 3 * 1000 }
1509
1510 pub fn object_store_streaming_read_retry_attempts() -> usize {
1511 DEFAULT_REQ_MAX_RETRY_ATTEMPTS
1512 }
1513
1514 pub fn object_store_metadata_attempt_timeout_ms() -> u64 {
1515 60 * 1000 }
1517
1518 pub fn object_store_metadata_retry_attempts() -> usize {
1519 DEFAULT_REQ_MAX_RETRY_ATTEMPTS
1520 }
1521
1522 pub fn object_store_delete_attempt_timeout_ms() -> u64 {
1523 5 * 1000
1524 }
1525
1526 pub fn object_store_delete_retry_attempts() -> usize {
1527 DEFAULT_REQ_MAX_RETRY_ATTEMPTS
1528 }
1529
1530 pub fn object_store_delete_objects_attempt_timeout_ms() -> u64 {
1532 5 * 1000
1533 }
1534
1535 pub fn object_store_delete_objects_retry_attempts() -> usize {
1536 DEFAULT_REQ_MAX_RETRY_ATTEMPTS
1537 }
1538
1539 pub fn object_store_list_attempt_timeout_ms() -> u64 {
1540 10 * 60 * 1000
1541 }
1542
1543 pub fn object_store_list_retry_attempts() -> usize {
1544 DEFAULT_REQ_MAX_RETRY_ATTEMPTS
1545 }
1546
1547 pub fn opendal_upload_concurrency() -> usize {
1548 256
1549 }
1550
1551 pub fn upload_part_size() -> usize {
1552 16 * 1024 * 1024
1554 }
1555
1556 pub mod s3 {
1557 const DEFAULT_IDENTITY_RESOLUTION_TIMEOUT_S: u64 = 5;
1558
1559 const DEFAULT_KEEPALIVE_MS: u64 = 600 * 1000; pub fn keepalive_ms() -> Option<u64> {
1562 Some(DEFAULT_KEEPALIVE_MS) }
1564
1565 pub fn recv_buffer_size() -> Option<usize> {
1566 Some(1 << 21) }
1568
1569 pub fn send_buffer_size() -> Option<usize> {
1570 None
1571 }
1572
1573 pub fn nodelay() -> Option<bool> {
1574 Some(true)
1575 }
1576
1577 pub fn identity_resolution_timeout_s() -> u64 {
1578 DEFAULT_IDENTITY_RESOLUTION_TIMEOUT_S
1579 }
1580
1581 pub mod developer {
1582 pub fn retry_unknown_service_error() -> bool {
1583 false
1584 }
1585
1586 pub fn retryable_service_error_codes() -> Vec<String> {
1587 vec!["SlowDown".into(), "TooManyRequests".into()]
1588 }
1589
1590 pub fn use_opendal() -> bool {
1591 true
1592 }
1593 }
1594 }
1595 }
1596}