yiguolei commented on code in PR #28940:
URL: https://github.com/apache/doris/pull/28940#discussion_r1437576011


##########
be/src/runtime/memory/lru_cache_policy.h:
##########
@@ -91,10 +136,22 @@ class LRUCachePolicy : public CachePolicy {
         }
     }
 
-    Cache* get() { return _cache.get(); }
+    // if init failed, not expect to using Cache, if forced to use, cache() 
will return dummy lru cache,
+    // compatible with ShardedLRUCache usage, but will not actually cache.
+    bool is_init() const { return _is_init; }
+
+    Cache* cache() const {
+        if (!_is_init) {
+            return ExecEnv::GetInstance()->get_dummy_lru_cache();
+        }
+        return _cache.get();
+    }
+
+    void reset() { _cache.reset(); }

Review Comment:
   这个函数有用么?
   



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

Reply via email to