Lchangliang commented on code in PR #12160:
URL: https://github.com/apache/doris/pull/12160#discussion_r965445444
##########
be/src/olap/tablet_schema_cache.h:
##########
@@ -52,6 +55,25 @@ class TabletSchemaCache {
return iter->second;
}
+private:
+ /**
+ * @brief recycle when TabletSchemaSPtr use_count equals 1.
+ */
+ void _recycle() {
+ for (;;) {
+ std::this_thread::sleep_for(
+
std::chrono::seconds(config::tablet_schema_cache_recycle_interval));
+ std::lock_guard guard(_mtx);
+ for (auto iter = _cache.begin(), last = _cache.end(); iter !=
last;) {
+ if (iter->second.use_count() == 1) {
+ iter = _cache.erase(iter);
+ } else {
+ ++iter;
+ }
+ }
Review Comment:
That won't have performance problem,because it just recycle schemas only
catched by tablet_schema_cache.
--
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]