AshinGau commented on code in PR #18652: URL: https://github.com/apache/doris/pull/18652#discussion_r1168380732
########## be/src/io/cache/block/block_file_cache.cpp: ########## @@ -51,16 +51,34 @@ IFileCache::Key IFileCache::hash(const std::string& path) { return Key(key); } -std::string IFileCache::get_path_in_local_cache(const Key& key, size_t offset, - bool is_persistent) const { - auto key_str = key.to_string(); - std::string suffix = is_persistent ? "_persistent" : ""; - if constexpr (USE_CACHE_VERSION2) { - return fs::path(_cache_base_path) / key_str.substr(0, KEY_PREFIX_LENGTH) / key_str / - (std::to_string(offset) + suffix); - } else { - return fs::path(_cache_base_path) / key_str / (std::to_string(offset) + suffix); +std::string IFileCache::cache_type_to_string(CacheType type) { + switch (type) { + case CacheType::INDEX: + return "_idx"; + case CacheType::DISPOSABLE: + return "_disposable"; + case CacheType::NORMAL: + return ""; + } + return ""; +} + +CacheType IFileCache::string_to_cache_type(const std::string& str) { Review Comment: Why does only match the first character? -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org