[opt](memory) All LRU Cache inherit from LRUCachePolicy (#28940)
After all LRU Cache inherits from LRUCachePolicy, this will allow prune stale entry, eviction when memory exceeds limit, and define common properties. LRUCache constructor change to private, only allow LRUCachePolicy to construct it. Impl DummyLRUCache, when LRU Cache capacity is 0, will no longer be meaningless insert and evict.
This commit is contained in:
@ -21,8 +21,8 @@
|
||||
|
||||
namespace doris {
|
||||
|
||||
CachePolicy::CachePolicy(CacheType type, uint32_t stale_sweep_time_s)
|
||||
: _type(type), _stale_sweep_time_s(stale_sweep_time_s) {
|
||||
CachePolicy::CachePolicy(CacheType type, uint32_t stale_sweep_time_s, bool enable_prune)
|
||||
: _type(type), _stale_sweep_time_s(stale_sweep_time_s), _enable_prune(enable_prune) {
|
||||
_it = CacheManager::instance()->register_cache(this);
|
||||
init_profile();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user