diff --git a/dbms/src/Server/StorageConfigParser.cpp b/dbms/src/Server/StorageConfigParser.cpp index 45462199420..8e4945dfc18 100644 --- a/dbms/src/Server/StorageConfigParser.cpp +++ b/dbms/src/Server/StorageConfigParser.cpp @@ -602,30 +602,30 @@ void StorageRemoteCacheConfig::initCacheDir() const { if (isCacheEnabled()) { - std::filesystem::create_directories(getStableCacheDir()); - std::filesystem::create_directories(getDeltaCacheDir()); + std::filesystem::create_directories(getDTFileCacheDir()); + std::filesystem::create_directories(getPageCacheDir()); } } -String StorageRemoteCacheConfig::getStableCacheDir() const +String StorageRemoteCacheConfig::getDTFileCacheDir() const { std::filesystem::path cache_root(dir); - // {dir}/stable - return cache_root /= "stable"; + // {dir}/dtfile + return cache_root /= "dtfile"; } -String StorageRemoteCacheConfig::getDeltaCacheDir() const +String StorageRemoteCacheConfig::getPageCacheDir() const { std::filesystem::path cache_root(dir); - // {dir}/delta - return cache_root /= "delta"; + // {dir}/page + return cache_root /= "page"; } -UInt64 StorageRemoteCacheConfig::getStableCapacity() const +UInt64 StorageRemoteCacheConfig::getDTFileCapacity() const { - return capacity - getDeltaCapacity(); + return capacity - getPageCapacity(); } -UInt64 StorageRemoteCacheConfig::getDeltaCapacity() const +UInt64 StorageRemoteCacheConfig::getPageCapacity() const { return capacity * delta_rate; } diff --git a/dbms/src/Server/StorageConfigParser.h b/dbms/src/Server/StorageConfigParser.h index 1c68887b027..70740891f58 100644 --- a/dbms/src/Server/StorageConfigParser.h +++ b/dbms/src/Server/StorageConfigParser.h @@ -119,10 +119,10 @@ struct StorageRemoteCacheConfig bool isCacheEnabled() const; void initCacheDir() const; - String getStableCacheDir() const; - String getDeltaCacheDir() const; - UInt64 getStableCapacity() const; - UInt64 getDeltaCapacity() const; + String getDTFileCacheDir() const; + String getPageCacheDir() const; + UInt64 getDTFileCapacity() const; + UInt64 getPageCapacity() const; void parse(const String & content, const LoggerPtr & log); }; diff --git a/dbms/src/Server/tests/gtest_storage_config.cpp b/dbms/src/Server/tests/gtest_storage_config.cpp index b96961917e2..6c411d2616d 100644 --- a/dbms/src/Server/tests/gtest_storage_config.cpp +++ b/dbms/src/Server/tests/gtest_storage_config.cpp @@ -898,10 +898,10 @@ delta_rate = 1.1 ASSERT_EQ(remote_cache_config.capacity, 10000000); ASSERT_EQ(remote_cache_config.dtfile_level, 11); ASSERT_DOUBLE_EQ(remote_cache_config.delta_rate, 0.33); - ASSERT_EQ(remote_cache_config.getStableCacheDir(), "/tmp/StorageConfigTest/RemoteCacheConfig/0/stable"); - ASSERT_EQ(remote_cache_config.getDeltaCacheDir(), "/tmp/StorageConfigTest/RemoteCacheConfig/0/delta"); - ASSERT_EQ(remote_cache_config.getStableCapacity() + remote_cache_config.getDeltaCapacity(), remote_cache_config.capacity); - ASSERT_DOUBLE_EQ(remote_cache_config.getStableCapacity() * 1.0 / remote_cache_config.capacity, 1.0 - remote_cache_config.delta_rate); + ASSERT_EQ(remote_cache_config.getDTFileCacheDir(), "/tmp/StorageConfigTest/RemoteCacheConfig/0/dtfile"); + ASSERT_EQ(remote_cache_config.getPageCacheDir(), "/tmp/StorageConfigTest/RemoteCacheConfig/0/page"); + ASSERT_EQ(remote_cache_config.getDTFileCapacity() + remote_cache_config.getPageCapacity(), remote_cache_config.capacity); + ASSERT_DOUBLE_EQ(remote_cache_config.getDTFileCapacity() * 1.0 / remote_cache_config.capacity, 1.0 - remote_cache_config.delta_rate); ASSERT_TRUE(remote_cache_config.isCacheEnabled()); } else