Skip to content

Commit a6b0b21

Browse files
committed
update
1 parent 13de3df commit a6b0b21

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

be/src/runtime/fragment_mgr.cpp

-11
Original file line numberDiff line numberDiff line change
@@ -305,17 +305,6 @@ void ConcurrentContextMap<Key, Value, ValueType>::clear() {
305305
}
306306
}
307307

308-
template <typename Key, typename Value, typename ValueType>
309-
size_t ConcurrentContextMap<Key, Value, ValueType>::num_items() const {
310-
size_t n = 0;
311-
for (auto& pair : _internal_map) {
312-
std::shared_lock lock(*pair.first);
313-
auto& map = pair.second;
314-
n += map.size();
315-
}
316-
return n;
317-
}
318-
319308
FragmentMgr::FragmentMgr(ExecEnv* exec_env)
320309
: _exec_env(exec_env), _stop_background_threads_latch(1) {
321310
_entity = DorisMetrics::instance()->metric_registry()->register_entity("FragmentMgr");

be/src/runtime/fragment_mgr.h

+9-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,15 @@ class ConcurrentContextMap {
7777
void insert(const Key& query_id, std::shared_ptr<ValueType>);
7878
void clear();
7979
void erase(const Key& query_id);
80-
size_t num_items() const;
80+
size_t num_items() const {
81+
size_t n = 0;
82+
for (auto& pair : _internal_map) {
83+
std::shared_lock lock(*pair.first);
84+
auto& map = pair.second;
85+
n += map.size();
86+
}
87+
return n;
88+
}
8189
void apply(ApplyFunction&& function) {
8290
for (auto& pair : _internal_map) {
8391
// TODO: Now only the cancel worker do the GC the _query_ctx_map. each query must

0 commit comments

Comments
 (0)