Skip to content

Commit

Permalink
refactor(config): remove no more used config
Browse files Browse the repository at this point in the history
Signed-off-by: MrCroxx <[email protected]>
  • Loading branch information
MrCroxx committed Apr 9, 2024
1 parent 21bea68 commit a2d57ad
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 56 deletions.
13 changes: 0 additions & 13 deletions src/common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -800,9 +800,6 @@ pub struct FileCacheConfig {
#[serde(default = "default::file_cache::insert_rate_limit_mb")]
pub insert_rate_limit_mb: usize,

#[serde(default = "default::file_cache::ring_buffer_capacity_mb")]
pub ring_buffer_capacity_mb: usize,

#[serde(default = "default::file_cache::catalog_bits")]
pub catalog_bits: usize,

Expand Down Expand Up @@ -1451,10 +1448,6 @@ pub mod default {
0
}

pub fn ring_buffer_capacity_mb() -> usize {
256
}

pub fn catalog_bits() -> usize {
6
}
Expand Down Expand Up @@ -1783,8 +1776,6 @@ pub struct StorageMemoryConfig {
pub meta_cache_capacity_mb: usize,
pub meta_cache_shard_num: usize,
pub shared_buffer_capacity_mb: usize,
pub data_file_cache_ring_buffer_capacity_mb: usize,
pub meta_file_cache_ring_buffer_capacity_mb: usize,
pub compactor_memory_limit_mb: usize,
pub prefetch_buffer_capacity_mb: usize,
pub block_cache_eviction_config: EvictionConfig,
Expand Down Expand Up @@ -1827,8 +1818,6 @@ pub fn extract_storage_memory_config(s: &RwConfig) -> StorageMemoryConfig {
}
shard_bits
});
let data_file_cache_ring_buffer_capacity_mb = s.storage.data_file_cache.ring_buffer_capacity_mb;
let meta_file_cache_ring_buffer_capacity_mb = s.storage.meta_file_cache.ring_buffer_capacity_mb;
let compactor_memory_limit_mb = s
.storage
.compactor_memory_limit_mb
Expand Down Expand Up @@ -1900,8 +1889,6 @@ pub fn extract_storage_memory_config(s: &RwConfig) -> StorageMemoryConfig {
meta_cache_capacity_mb,
meta_cache_shard_num,
shared_buffer_capacity_mb,
data_file_cache_ring_buffer_capacity_mb,
meta_file_cache_ring_buffer_capacity_mb,
compactor_memory_limit_mb,
prefetch_buffer_capacity_mb,
block_cache_eviction_config,
Expand Down
21 changes: 0 additions & 21 deletions src/compute/src/memory/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,26 +123,13 @@ pub fn storage_memory_config(
.unwrap_or(default_block_cache_capacity_mb),
);

let data_file_cache_ring_buffer_capacity_mb = if storage_config.data_file_cache.dir.is_empty() {
0
} else {
storage_config.data_file_cache.ring_buffer_capacity_mb
};
let meta_file_cache_ring_buffer_capacity_mb = if storage_config.meta_file_cache.dir.is_empty() {
0
} else {
storage_config.meta_file_cache.ring_buffer_capacity_mb
};

let compactor_memory_limit_mb = storage_config.compactor_memory_limit_mb.unwrap_or(
((non_reserved_memory_bytes as f64 * compactor_memory_proportion).ceil() as usize) >> 20,
);

let total_calculated_mb = block_cache_capacity_mb
+ meta_cache_capacity_mb
+ shared_buffer_capacity_mb
+ data_file_cache_ring_buffer_capacity_mb
+ meta_file_cache_ring_buffer_capacity_mb
+ compactor_memory_limit_mb;
let soft_limit_mb = (non_reserved_memory_bytes as f64
* (storage_memory_proportion + compactor_memory_proportion).ceil())
Expand Down Expand Up @@ -234,8 +221,6 @@ pub fn storage_memory_config(
meta_cache_capacity_mb,
meta_cache_shard_num,
shared_buffer_capacity_mb,
data_file_cache_ring_buffer_capacity_mb,
meta_file_cache_ring_buffer_capacity_mb,
compactor_memory_limit_mb,
prefetch_buffer_capacity_mb,
block_cache_eviction_config,
Expand Down Expand Up @@ -273,8 +258,6 @@ mod tests {
assert_eq!(memory_config.block_cache_capacity_mb, 737);
assert_eq!(memory_config.meta_cache_capacity_mb, 860);
assert_eq!(memory_config.shared_buffer_capacity_mb, 737);
assert_eq!(memory_config.data_file_cache_ring_buffer_capacity_mb, 0);
assert_eq!(memory_config.meta_file_cache_ring_buffer_capacity_mb, 0);
assert_eq!(memory_config.compactor_memory_limit_mb, 819);

storage_config.data_file_cache.dir = "data".to_string();
Expand All @@ -284,8 +267,6 @@ mod tests {
assert_eq!(memory_config.block_cache_capacity_mb, 737);
assert_eq!(memory_config.meta_cache_capacity_mb, 860);
assert_eq!(memory_config.shared_buffer_capacity_mb, 737);
assert_eq!(memory_config.data_file_cache_ring_buffer_capacity_mb, 256);
assert_eq!(memory_config.meta_file_cache_ring_buffer_capacity_mb, 256);
assert_eq!(memory_config.compactor_memory_limit_mb, 819);

storage_config.cache.block_cache_capacity_mb = Some(512);
Expand All @@ -296,8 +277,6 @@ mod tests {
assert_eq!(memory_config.block_cache_capacity_mb, 512);
assert_eq!(memory_config.meta_cache_capacity_mb, 128);
assert_eq!(memory_config.shared_buffer_capacity_mb, 1024);
assert_eq!(memory_config.data_file_cache_ring_buffer_capacity_mb, 256);
assert_eq!(memory_config.meta_file_cache_ring_buffer_capacity_mb, 256);
assert_eq!(memory_config.compactor_memory_limit_mb, 512);
}
}
6 changes: 0 additions & 6 deletions src/compute/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,6 @@ fn total_storage_memory_limit_bytes(storage_memory_config: &StorageMemoryConfig)
let total_storage_memory_mb = storage_memory_config.block_cache_capacity_mb
+ storage_memory_config.meta_cache_capacity_mb
+ storage_memory_config.shared_buffer_capacity_mb
+ storage_memory_config.data_file_cache_ring_buffer_capacity_mb
+ storage_memory_config.meta_file_cache_ring_buffer_capacity_mb
+ storage_memory_config.compactor_memory_limit_mb;
total_storage_memory_mb << 20
}
Expand Down Expand Up @@ -530,8 +528,6 @@ fn print_memory_config(
> block_cache_capacity: {}\n\
> meta_cache_capacity: {}\n\
> shared_buffer_capacity: {}\n\
> data_file_cache_buffer_pool_capacity: {}\n\
> meta_file_cache_buffer_pool_capacity: {}\n\
> compactor_memory_limit: {}\n\
> compute_memory: {}\n\
> reserved_memory: {}",
Expand All @@ -540,8 +536,6 @@ fn print_memory_config(
convert((storage_memory_config.block_cache_capacity_mb << 20) as _),
convert((storage_memory_config.meta_cache_capacity_mb << 20) as _),
convert((storage_memory_config.shared_buffer_capacity_mb << 20) as _),
convert((storage_memory_config.data_file_cache_ring_buffer_capacity_mb << 20) as _),
convert((storage_memory_config.meta_file_cache_ring_buffer_capacity_mb << 20) as _),
if embedded_compactor_enabled {
convert((storage_memory_config.compactor_memory_limit_mb << 20) as _)
} else {
Expand Down
2 changes: 0 additions & 2 deletions src/config/example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ recover_concurrency = 8
lfu_window_to_cache_size_ratio = 1
lfu_tiny_lru_capacity_ratio = 0.01
insert_rate_limit_mb = 0
ring_buffer_capacity_mb = 256
catalog_bits = 6
compression = "none"

Expand All @@ -171,7 +170,6 @@ recover_concurrency = 8
lfu_window_to_cache_size_ratio = 1
lfu_tiny_lru_capacity_ratio = 0.01
insert_rate_limit_mb = 0
ring_buffer_capacity_mb = 256
catalog_bits = 6
compression = "none"

Expand Down
2 changes: 0 additions & 2 deletions src/storage/src/hummock/file_cache/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ where
pub lfu_window_to_cache_size_ratio: usize,
pub lfu_tiny_lru_capacity_ratio: f64,
pub insert_rate_limit: usize,
pub ring_buffer_capacity: usize,
pub catalog_bits: usize,
pub admissions: Vec<Arc<dyn AdmissionPolicy<Key = K, Value = V>>>,
pub reinsertions: Vec<Arc<dyn ReinsertionPolicy<Key = K, Value = V>>>,
Expand All @@ -100,7 +99,6 @@ where
lfu_window_to_cache_size_ratio: self.lfu_window_to_cache_size_ratio,
lfu_tiny_lru_capacity_ratio: self.lfu_tiny_lru_capacity_ratio,
insert_rate_limit: self.insert_rate_limit,
ring_buffer_capacity: self.ring_buffer_capacity,
catalog_bits: self.catalog_bits,
admissions: self.admissions.clone(),
reinsertions: self.reinsertions.clone(),
Expand Down
10 changes: 0 additions & 10 deletions src/storage/src/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ pub struct StorageOpts {
pub data_file_cache_lfu_window_to_cache_size_ratio: usize,
pub data_file_cache_lfu_tiny_lru_capacity_ratio: f64,
pub data_file_cache_insert_rate_limit_mb: usize,
pub data_file_cache_ring_buffer_capacity_mb: usize,
pub data_file_cache_catalog_bits: usize,
pub data_file_cache_compression: String,

Expand All @@ -114,7 +113,6 @@ pub struct StorageOpts {
pub meta_file_cache_lfu_window_to_cache_size_ratio: usize,
pub meta_file_cache_lfu_tiny_lru_capacity_ratio: f64,
pub meta_file_cache_insert_rate_limit_mb: usize,
pub meta_file_cache_ring_buffer_capacity_mb: usize,
pub meta_file_cache_catalog_bits: usize,
pub meta_file_cache_compression: String,

Expand Down Expand Up @@ -206,10 +204,6 @@ impl From<(&RwConfig, &SystemParamsReader, &StorageMemoryConfig)> for StorageOpt
.data_file_cache
.lfu_tiny_lru_capacity_ratio,
data_file_cache_insert_rate_limit_mb: c.storage.data_file_cache.insert_rate_limit_mb,
data_file_cache_ring_buffer_capacity_mb: c
.storage
.data_file_cache
.ring_buffer_capacity_mb,
data_file_cache_catalog_bits: c.storage.data_file_cache.catalog_bits,
data_file_cache_compression: c.storage.data_file_cache.compression.clone(),
meta_file_cache_dir: c.storage.meta_file_cache.dir.clone(),
Expand All @@ -229,10 +223,6 @@ impl From<(&RwConfig, &SystemParamsReader, &StorageMemoryConfig)> for StorageOpt
.meta_file_cache
.lfu_tiny_lru_capacity_ratio,
meta_file_cache_insert_rate_limit_mb: c.storage.meta_file_cache.insert_rate_limit_mb,
meta_file_cache_ring_buffer_capacity_mb: c
.storage
.meta_file_cache
.ring_buffer_capacity_mb,
meta_file_cache_catalog_bits: c.storage.meta_file_cache.catalog_bits,
meta_file_cache_compression: c.storage.meta_file_cache.compression.clone(),
cache_refill_data_refill_levels: c.storage.cache_refill.data_refill_levels.clone(),
Expand Down
2 changes: 0 additions & 2 deletions src/storage/src/store_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,6 @@ impl StateStoreImpl {
flushers: opts.data_file_cache_flushers,
reclaimers: opts.data_file_cache_reclaimers,
recover_concurrency: opts.data_file_cache_recover_concurrency,
ring_buffer_capacity: opts.data_file_cache_ring_buffer_capacity_mb * MB,
catalog_bits: opts.data_file_cache_catalog_bits,
admissions: vec![],
reinsertions: vec![],
Expand Down Expand Up @@ -624,7 +623,6 @@ impl StateStoreImpl {
flushers: opts.meta_file_cache_flushers,
reclaimers: opts.meta_file_cache_reclaimers,
recover_concurrency: opts.meta_file_cache_recover_concurrency,
ring_buffer_capacity: opts.meta_file_cache_ring_buffer_capacity_mb * MB,
catalog_bits: opts.meta_file_cache_catalog_bits,
admissions: vec![],
reinsertions: vec![],
Expand Down

0 comments on commit a2d57ad

Please sign in to comment.