Skip to content

Commit

Permalink
chore: tiny renaming
Browse files Browse the repository at this point in the history
Signed-off-by: MrCroxx <[email protected]>
  • Loading branch information
MrCroxx committed Mar 18, 2024
1 parent f161847 commit c02c031
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,7 @@ pub struct StorageMemoryConfig {

pub const MAX_META_CACHE_SHARD_BITS: usize = 4;
pub const MIN_BUFFER_SIZE_PER_SHARD: usize = 256;
pub const MAX_CACHE_SHARD_BITS: usize = 6; // It means that there will be 64 shards lru-cache to avoid lock conflict.
pub const MAX_BLOCK_CACHE_SHARD_BITS: usize = 6; // It means that there will be 64 shards lru-cache to avoid lock conflict.

pub fn extract_storage_memory_config(s: &RwConfig) -> StorageMemoryConfig {
let block_cache_capacity_mb = s.storage.cache.block_cache_capacity_mb.unwrap_or(
Expand All @@ -1758,7 +1758,7 @@ pub fn extract_storage_memory_config(s: &RwConfig) -> StorageMemoryConfig {
shard_bits
});
let block_cache_shard_num = s.storage.cache.block_cache_shard_num.unwrap_or_else(|| {
let mut shard_bits = MAX_CACHE_SHARD_BITS;
let mut shard_bits = MAX_BLOCK_CACHE_SHARD_BITS;
while (block_cache_capacity_mb >> shard_bits) < MIN_BUFFER_SIZE_PER_SHARD && shard_bits > 0
{
shard_bits -= 1;
Expand Down
4 changes: 2 additions & 2 deletions src/compute/src/memory/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

use foyer::memory::{LfuConfig, LruConfig};
use risingwave_common::config::{
CacheEvictionConfig, EvictionConfig, StorageConfig, StorageMemoryConfig, MAX_CACHE_SHARD_BITS,
CacheEvictionConfig, EvictionConfig, StorageConfig, StorageMemoryConfig, MAX_BLOCK_CACHE_SHARD_BITS,
MAX_META_CACHE_SHARD_BITS, MIN_BUFFER_SIZE_PER_SHARD,
};
use risingwave_common::util::pretty_bytes::convert;
Expand Down Expand Up @@ -173,7 +173,7 @@ pub fn storage_memory_config(
.cache
.block_cache_shard_num
.unwrap_or_else(|| {
let mut shard_bits = MAX_CACHE_SHARD_BITS;
let mut shard_bits = MAX_BLOCK_CACHE_SHARD_BITS;
while (block_cache_capacity_mb >> shard_bits) < MIN_BUFFER_SIZE_PER_SHARD
&& shard_bits > 0
{
Expand Down

0 comments on commit c02c031

Please sign in to comment.