yangzhg commented on a change in pull request #7198:
URL: https://github.com/apache/incubator-doris/pull/7198#discussion_r762685427



##########
File path: be/src/runtime/mem_tracker.cpp
##########
@@ -233,41 +260,71 @@ int64_t MemTracker::GetPoolMemReserved() {
                 // Make sure we don't overflow if the query limits are set to 
ridiculous values.
                 mem_reserved += std::min(child_limit, MemInfo::physical_mem());
             } else {
-                DCHECK(child_limit == -1)
-                        << child->LogUsage(UNLIMITED_DEPTH);
+                DCHECK(child_limit == -1) << child->LogUsage(UNLIMITED_DEPTH);
                 mem_reserved += child->consumption();
             }
         }
     }
     return mem_reserved;
 }
 
-std::shared_ptr<MemTracker> PoolMemTrackerRegistry::GetRequestPoolMemTracker(
-        const string& pool_name, bool create_if_not_present) {
-    DCHECK(!pool_name.empty());
-    lock_guard<SpinLock> l(pool_to_mem_trackers_lock_);
-    PoolTrackersMap::iterator it = pool_to_mem_trackers_.find(pool_name);
-    if (it != pool_to_mem_trackers_.end()) {
-        MemTracker* tracker = it->second.get();
-        DCHECK(pool_name == tracker->pool_name_);
-        return it->second;
+std::shared_ptr<MemTracker> QueryMemTrackerRegistry::RegisterQueryMemTracker(
+        const std::string& query_id, int64_t mem_limit) {
+    DCHECK(!query_id.empty());
+    VLOG(2) << "Register query memory tracker, query id: " << query_id

Review comment:
       Using macros defined in `be/src/common/logging.h`, not use the number 
directly




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to