yiguolei commented on code in PR #49040:
URL: https://github.com/apache/doris/pull/49040#discussion_r2196670274
##########
be/src/olap/rowset/segment_v2/segment.cpp:
##########
@@ -87,6 +87,64 @@ std::string file_cache_key_str(const std::string& seg_path) {
return file_cache_key_from_path(seg_path).to_string();
}
+bvar::Adder<int64_t>
g_segment_column_cache_count("segment_column_cache_count");
+bvar::Adder<int64_t>
g_segment_column_cache_hit_count("segment_column_cache_hit_count");
+bvar::Adder<int64_t>
g_segment_column_cache_miss_count("segment_column_cache_miss_count");
+bvar::Adder<int64_t>
g_segment_column_cache_evict_count("segment_column_cache_evict_count");
+
+std::shared_ptr<ColumnReader> ColumnReaderCache::lookup(const
ColumnReaderCacheKey& key) {
+ std::lock_guard<std::mutex> lock(_cache_mutex);
+ auto it = _cache_map.find(key);
+ if (it == _cache_map.end()) {
+ g_segment_column_cache_miss_count << 1;
+ return nullptr;
+ }
+ // Move the accessed node to the front of the linked list
+ _lru_list.splice(_lru_list.begin(), _lru_list, it->second);
+ DCHECK_EQ(it->second->key.first, key.first);
+ g_segment_column_cache_hit_count << 1;
+ return it->second->reader;
+}
+
+Status ColumnReaderCache::insert(const ColumnReaderCacheKey& key, const
ColumnReaderOptions& opts,
Review Comment:
这个代码补充一下单侧
--
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]