xinyiZzz commented on code in PR #10921: URL: https://github.com/apache/doris/pull/10921#discussion_r922758205
########## be/src/olap/tablet_meta.cpp: ########## @@ -869,4 +876,55 @@ void DeleteBitmap::merge(const DeleteBitmap& other) { } } +// FIXME: do we need a mutex here to get rid of duplicated initializations +// of cache entries in some cases? +std::shared_ptr<roaring::Roaring> DeleteBitmap::get_agg(const BitmapKey& bmk) const { + std::string key_str = AggCache::new_key(bmk); + CacheKey key(key_str); + Cache::Handle* handle = _agg_cache->lookup(key); + + AggCache::Value* val = handle == nullptr + ? nullptr + : reinterpret_cast<AggCache::Value*>(_agg_cache->value(handle)); + static auto ts_ms = [] { + return std::chrono::duration_cast<std::chrono::milliseconds>( + std::chrono::system_clock::now().time_since_epoch()) + .count(); + }; + // Renew if needed + if (val == nullptr || (val->expiration > 0 && val->expiration < ts_ms())) { Review Comment: expiration evict policy. maybe it can be added to LRUCache later. -- 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