This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 96d708b70899f14e00c7fcae7c854ede95eaa69c
Author: 神技圈子 <[email protected]>
AuthorDate: Thu Sep 14 14:28:19 2023 +0800

    [Enhancement]The page cache can be parameterized by the session variable of 
fe. (#23981)
---
 be/src/runtime/runtime_state.h                            |  5 +++++
 be/src/vec/exec/scan/new_olap_scanner.cpp                 |  4 +---
 .../main/java/org/apache/doris/qe/SessionVariable.java    | 15 +++++++++++++++
 gensrc/thrift/PaloInternalService.thrift                  |  1 +
 4 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/be/src/runtime/runtime_state.h b/be/src/runtime/runtime_state.h
index f1d49ac281..ac9c2bcdb0 100644
--- a/be/src/runtime/runtime_state.h
+++ b/be/src/runtime/runtime_state.h
@@ -340,6 +340,11 @@ public:
         return _query_options.__isset.skip_delete_bitmap && 
_query_options.skip_delete_bitmap;
     }
 
+    bool enable_page_cache() const {
+        return !config::disable_storage_page_cache &&
+               (_query_options.__isset.enable_page_cache && 
_query_options.enable_page_cache);
+    }
+
     int partitioned_hash_join_rows_threshold() const {
         if (!_query_options.__isset.partitioned_hash_join_rows_threshold) {
             return 0;
diff --git a/be/src/vec/exec/scan/new_olap_scanner.cpp 
b/be/src/vec/exec/scan/new_olap_scanner.cpp
index 5ddc56bcb7..852d9a3ce6 100644
--- a/be/src/vec/exec/scan/new_olap_scanner.cpp
+++ b/be/src/vec/exec/scan/new_olap_scanner.cpp
@@ -370,9 +370,7 @@ Status NewOlapScanner::_init_tablet_reader_params(
         }
     }
 
-    if (!config::disable_storage_page_cache) {
-        _tablet_reader_params.use_page_cache = true;
-    }
+    _tablet_reader_params.use_page_cache = _state->enable_page_cache();
 
     if (_tablet->enable_unique_key_merge_on_write() && 
!_state->skip_delete_bitmap()) {
         _tablet_reader_params.delete_bitmap = 
&_tablet->tablet_meta()->delete_bitmap();
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
index 56b8ab9011..242241d1c3 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
@@ -334,6 +334,10 @@ public class SessionVariable implements Serializable, 
Writable {
 
     public static final String ENABLE_MINIDUMP = "enable_minidump";
 
+    public static final String ENABLE_PAGE_CACHE = "enable_page_cache";
+
+    public static final String MINIDUMP_PATH = "minidump_path";
+
     public static final String TRACE_NEREIDS = "trace_nereids";
 
     public static final String PLAN_NEREIDS_DUMP = "plan_nereids_dump";
@@ -1015,6 +1019,15 @@ public class SessionVariable implements Serializable, 
Writable {
     @VariableMgr.VarAttr(name = ENABLE_MINIDUMP)
     public boolean enableMinidump = false;
 
+
+    @VariableMgr.VarAttr(
+            name = ENABLE_PAGE_CACHE,
+            description = {"控制是否启用page cache。默认为 true。",
+                "Controls whether to use page cache. "
+                    + "The default value is true."},
+            needForward = true)
+    public boolean enablePageCache = true;
+
     @VariableMgr.VarAttr(name = ENABLE_FOLD_NONDETERMINISTIC_FN)
     public boolean enableFoldNondeterministicFn = false;
 
@@ -2179,6 +2192,8 @@ public class SessionVariable implements Serializable, 
Writable {
 
         tResult.setEnableFileCache(enableFileCache);
 
+        tResult.setEnablePageCache(enablePageCache);
+
         tResult.setFileCacheBasePath(fileCacheBasePath);
 
         tResult.setEnableInvertedIndexQuery(enableInvertedIndexQuery);
diff --git a/gensrc/thrift/PaloInternalService.thrift 
b/gensrc/thrift/PaloInternalService.thrift
index e3a2f58059..b4c852b4ce 100644
--- a/gensrc/thrift/PaloInternalService.thrift
+++ b/gensrc/thrift/PaloInternalService.thrift
@@ -245,6 +245,7 @@ struct TQueryOptions {
   // A seperate flag to indicate whether to enable profile, not
   // use is_report_success any more
   84: optional bool enable_profile = false;
+  85: optional bool enable_page_cache = false;
 }
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to