morningman 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_r236072019
##########
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:
Capacity is set in Store.cpp. And I think the capacity will not change. If
it changes, the Backend process must be restarted and the capacity is set when
store is being initialized.
----------------------------------------------------------------
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]