yiguolei commented on code in PR #29588:
URL: https://github.com/apache/doris/pull/29588#discussion_r1442706881
##########
be/src/olap/lru_cache.cpp:
##########
@@ -356,8 +356,12 @@ Cache::Handle* LRUCache::insert(const CacheKey& key,
uint32_t hash, void* value,
e->deleter = deleter;
e->charge = charge;
e->key_length = key.size();
- e->total_size = (_type == LRUCacheType::SIZE ? handle_size + charge : 1);
+ // if LRUCacheType::NUMBER, charge not add handle_size,
+ // because charge at this time is no longer the memory size, but an weight.
+ e->total_size = (_type == LRUCacheType::SIZE ? handle_size + charge :
charge);
Review Comment:
why lRUTYPE::number need charge??
##########
be/src/olap/lru_cache.cpp:
##########
@@ -356,8 +356,12 @@ Cache::Handle* LRUCache::insert(const CacheKey& key,
uint32_t hash, void* value,
e->deleter = deleter;
e->charge = charge;
e->key_length = key.size();
- e->total_size = (_type == LRUCacheType::SIZE ? handle_size + charge : 1);
+ // if LRUCacheType::NUMBER, charge not add handle_size,
+ // because charge at this time is no longer the memory size, but an weight.
+ e->total_size = (_type == LRUCacheType::SIZE ? handle_size + charge :
charge);
Review Comment:
why lRUTYPE::number need charge??
--
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]