chaoyli commented on a change in pull request #349: Improve the Backend's disk 
info report performance
URL: https://github.com/apache/incubator-doris/pull/349#discussion_r236070402
 
 

 ##########
 File path: be/src/olap/olap_engine.cpp
 ##########
 @@ -529,20 +529,60 @@ OLAPStatus 
OLAPEngine::get_all_root_path_info(vector<RootPathInfo>* root_paths_i
     OLAPStatus res = OLAP_SUCCESS;
     root_paths_info->clear();
 
-    std::lock_guard<std::mutex> l(_store_lock);
-    for (auto& it : _store_map) {
-        root_paths_info->emplace_back(it.second->to_root_path_info());
+    MonotonicStopWatch timer;
+    timer.start();
+    int tablet_counter = 0;
+
+    // get all root path info and construct a path map.
+    // path -> RootPathInfo
+    std::map<std::string, RootPathInfo> path_map;
+    {
+        std::lock_guard<std::mutex> l(_store_lock);
+        for (auto& it : _store_map) {
+            std::string path = it.first;
+            path_map.emplace(path, it.second->to_root_path_info());
+            // if this path is not used, init it's info
+            if (!path_map[path].is_used) {
+                path_map[path].capacity = 1;
 
 Review comment:
   It seems that value of capacity variable is not updated?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to