levy5307 commented on a change in pull request #8146:
URL: https://github.com/apache/incubator-doris/pull/8146#discussion_r818274107



##########
File path: be/src/olap/tablet_manager.h
##########
@@ -228,12 +226,8 @@ class TabletManager {
     std::map<int64_t, std::set<TabletInfo>> _partition_tablet_map;
     std::vector<TabletSharedPtr> _shutdown_tablets;
 
-    std::mutex _tablet_stat_mutex;
-    // cache to save tablets' statistics, such as data-size and row-count
-    // TODO(cmy): for now, this is a naive implementation
-    std::map<int64_t, TTabletStat> _tablet_stat_cache;
-    // last update time of tablet stat cache
-    int64_t _last_update_stat_ms;
+    std::mutex _tablet_stat_cache_mutex;
+    std::shared_ptr<std::vector<TTabletStat>> _tablet_stat_list_cache = 
std::make_shared<std::vector<TTabletStat>>();

Review comment:
       What about std::unique_ptr? It is more efficient than std::shared_ptr




-- 
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