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


##########
be/src/runtime/thread_context.cpp:
##########
@@ -23,6 +23,12 @@
 namespace doris {
 class MemTracker;
 
+QueryThreadContext ThreadContext::query_thread_context() {

Review Comment:
   warning: method 'query_thread_context' can be made const 
[readability-make-member-function-const]
   
   be/src/runtime/thread_context.h:177:
   ```diff
   -     QueryThreadContext query_thread_context();
   +     QueryThreadContext query_thread_context() const;
   ```
   
   ```suggestion
   QueryThreadContext ThreadContext::query_thread_context() const {
   ```
   



##########
be/src/runtime/fragment_mgr.cpp:
##########
@@ -585,6 +581,37 @@ void FragmentMgr::remove_pipeline_context(
     }
 }
 
+std::shared_ptr<MemTrackerLimiter> FragmentMgr::_init_query_mem_tracker(

Review Comment:
   warning: method '_init_query_mem_tracker' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
   static std::shared_ptr<MemTrackerLimiter> 
FragmentMgr::_init_query_mem_tracker(
   ```
   



##########
be/src/runtime/fragment_mgr.cpp:
##########
@@ -967,6 +1002,15 @@
 #endif
 }
 
+std::shared_ptr<QueryContext> FragmentMgr::get_query_context_unlocked(const 
TUniqueId& query_id) {

Review Comment:
   warning: method 'get_query_context_unlocked' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
   static std::shared_ptr<QueryContext> 
FragmentMgr::get_query_context_unlocked(const TUniqueId& query_id) {
   ```
   



##########
be/src/runtime/thread_context.h:
##########
@@ -266,10 +274,30 @@ static ThreadContext* thread_context() {
         DCHECK(bthread_context != nullptr);
         return bthread_context;
     }
+    // It means that use thread_context() but this thread not attached a 
query/load using SCOPED_ATTACH_TASK macro.
     LOG(FATAL) << "__builtin_unreachable";
     __builtin_unreachable();
 }
 
+class QueryThreadContext {
+public:
+    QueryThreadContext() = default;
+    QueryThreadContext(const TUniqueId& query_id,
+                       const std::shared_ptr<MemTrackerLimiter>& mem_tracker)
+            : query_id(query_id), query_mem_tracker(mem_tracker) {}
+
+    void init() {

Review Comment:
   warning: method 'init' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
       static void init() {
   ```
   



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