You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "github-actions[bot] (via GitHub)" <gi...@apache.org> on 2023/03/22 11:31:34 UTC

[GitHub] [doris] github-actions[bot] commented on a diff in pull request #18033: [Refactor](inverted index cache) Use asc set instead of priority queue at the lru cache

github-actions[bot] commented on code in PR #18033:
URL: https://github.com/apache/doris/pull/18033#discussion_r1144657067


##########
be/src/olap/lru_cache.h:
##########
@@ -314,13 +314,10 @@ class HandleTable {
     void _resize();
 };
 
-// pair first is timestatmp, put <timestatmp, LRUHandle*> into asc priority_queue,
-// when need to free space, can first evict the top of the LRUHandleHeap,
-// because the top element's timestamp is the oldest.
-typedef std::priority_queue<std::pair<int64_t, LRUHandle*>,
-                            std::vector<std::pair<int64_t, LRUHandle*>>,
-                            std::greater<std::pair<int64_t, LRUHandle*>>>
-        LRUHandleHeap;
+// pair first is timestatmp, put <timestatmp, LRUHandle*> into asc set,
+// when need to free space, can first evict the begin of the set,
+// because the begin element's timestamp is the oldest.
+typedef std::set<std::pair<int64_t, LRUHandle*>> LRUHandleAscSet;

Review Comment:
   warning: use 'using' instead of 'typedef' [modernize-use-using]
   
   ```suggestion
   using LRUHandleAscSet = std::set<std::pair<int64_t, LRUHandle *>>;
   ```
   



-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org