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 on 2023/01/30 12:20:38 UTC

[GitHub] [doris] github-actions[bot] commented on a diff in pull request #16263: [Improve](row-store) support row cache

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


##########
be/src/service/point_query_executor.h:
##########
@@ -63,10 +66,93 @@ class Reusable {
     int64_t _create_timestamp = 0;
 };
 
+// RowCache is a LRU cache for row store
+class RowCache {
+public:
+    // The cache key for row lru cache
+    struct RowCacheKey {
+        RowCacheKey(int64_t tablet_id, const Slice& key) : tablet_id(tablet_id), key(key) {}
+        int64_t tablet_id;
+        Slice key;
+
+        // Encode to a flat binary which can be used as LRUCache's key
+        std::string encode() const {
+            std::string full_key;
+            full_key.resize(sizeof(int64_t) + key.size);
+            int8store(&full_key.front(), tablet_id);
+            memcpy((&full_key.front()) + sizeof(tablet_id), key.data, key.size);
+            return full_key;
+        }
+    };
+
+    // A handle for RowCache entry. This class make it easy to handle
+    // Cache entry. Users don't need to release the obtained cache entry. This
+    // class will release the cache entry when it is destroyed.
+    class CacheHandle {
+    public:
+        CacheHandle() {}

Review Comment:
   warning: use '= default' to define a trivial default constructor [modernize-use-equals-default]
   
   ```suggestion
           CacheHandle() = default;
   ```
   



-- 
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