xinyiZzz commented on a change in pull request #7198:
URL: https://github.com/apache/incubator-doris/pull/7198#discussion_r762820686
##########
File path: be/src/runtime/mem_tracker.h
##########
@@ -573,33 +611,33 @@ class MemTracker : public
std::enable_shared_from_this<MemTracker> {
IntGauge* limit_metric_;
};
-/// Global registry for query and pool MemTrackers. Owned by ExecEnv.
-class PoolMemTrackerRegistry {
+// Global registry for query MemTrackers. Owned by ExecEnv.
+class QueryMemTrackerRegistry {
public:
- /// Returns a MemTracker object for request pool 'pool_name'. Calling this
with the same
- /// 'pool_name' will return the same MemTracker object. This is used to
track the local
- /// memory usage of all requests executing in this pool. If
'create_if_not_present' is
- /// true, the first time this is called for a pool, a new MemTracker
object is created
- /// with the process tracker as its parent. There is no explicit per-pool
byte_limit
- /// set at any particular impalad, so newly created trackers will always
have a limit
- /// of -1.
- /// TODO(cmy): this function is not used for now. the memtracker returned
from here is
- /// got from a shared_ptr in `pool_to_mem_trackers_`.
- /// This funtion is from
- ///
https://github.com/cloudera/Impala/blob/495397101e5807c701df71ea288f4815d69c2c8a/be/src/runtime/mem-tracker.h#L497
- /// And in impala this function will return a raw pointer.
- std::shared_ptr<MemTracker> GetRequestPoolMemTracker(const std::string&
pool_name,
- bool
create_if_not_present);
+ // Construct a MemTracker object for 'query_id' with 'mem_limit' as the
memory limit.
+ // The MemTracker is a child of the process MemTracker, Calling this with
the same
+ // 'query_id' will return the same MemTracker object. This is used to
track the local
+ // memory usage of all querys executing. The first time this is called for
a query,
+ // a new MemTracker object is created with the process tracker as its
parent.
+ // Newly created trackers will always have a limit of -1.
+ std::shared_ptr<MemTracker> RegisterQueryMemTracker(const std::string&
query_id,
Review comment:
done,
The naming format of this file still follows the impala ==, I will rewrite
it later
--
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]