xuchenhao commented on code in PR #57353:
URL: https://github.com/apache/doris/pull/57353#discussion_r2468088959
##########
be/src/io/cache/block_file_cache.cpp:
##########
@@ -874,6 +949,65 @@ FileBlockCell* BlockFileCache::add_cell(const
UInt128Wrapper& hash, const CacheC
<< " error=" << st.msg();
}
+ if (config::enable_normal_queue_cold_hot_separation &&
+ cell.file_block->cache_type() == FileCacheType::NORMAL) {
+ cell.file_block->set_cache_type(FileCacheType::COLD_NORMAL);
+ }
+
+ auto& queue = get_queue(cell.file_block->cache_type());
+ cell.queue_iterator = queue.add(hash, offset, size, cache_lock);
+ _lru_recorder->record_queue_event(cell.file_block->cache_type(),
CacheLRULogType::ADD,
+ cell.file_block->get_hash_value(),
cell.file_block->offset(),
+ cell.size());
+
+ if (cell.file_block->cache_type() == FileCacheType::TTL) {
+ if (_key_to_time.find(hash) == _key_to_time.end()) {
+ _key_to_time[hash] = context.expiration_time;
+ _time_to_key.insert(std::make_pair(context.expiration_time, hash));
+ }
+ _cur_ttl_size += cell.size();
+ }
+ auto [it, _] = offsets.insert(std::make_pair(offset, std::move(cell)));
+ _cur_cache_size += size;
+ return &(it->second);
+}
+
+FileBlockCell* BlockFileCache::add_cell_directly(const UInt128Wrapper& hash,
Review Comment:
加一个参数项,for dump,两者共用一个add_cell函数
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]