platoneko commented on code in PR #34003:
URL: https://github.com/apache/doris/pull/34003#discussion_r1577427949


##########
be/src/olap/tablet.cpp:
##########


Review Comment:
   ```c++
   void CloudTablet::clear_cache() override {
       CloudTablet::recycle_cached_data(get_snapshot_rowset(true));
       _engine.tablet_mgr().erase_tablet(tablet_id());
   }
   
   void CloudTablet::recycle_cached_data(const std::vector<RowsetSharedPtr>& 
rowsets) {
       for (auto& rs : rowsets) {
           // Clear cached opened segments and inverted index cache in memory
           rs->clear_cache();
       }
   
       if (config::enable_file_cache) {
           for (const auto& rs : rowsets) {
               for (int seg_id = 0; seg_id < rs->num_segments(); ++seg_id) {
                   auto seg_path = rs->segment_file_path(seg_id);
                   auto file_key = 
io::BlockFileCache::hash(io::Path(seg_path).filename().native());
                   auto* file_cache = 
io::FileCacheFactory::instance()->get_by_path(file_key);
                   file_cache->remove_if_cached(file_key);
               }
           }
       }
   }
   ```



##########
be/src/olap/base_tablet.h:
##########
@@ -241,6 +241,8 @@ class BaseTablet {
 
     std::vector<RowsetSharedPtr> get_snapshot_rowset(bool include_stale_rowset 
= false) const;
 
+    virtual void clear_cache() { LOG(INFO) << "should not reach here"; }

Review Comment:
   
   ```suggestion
       virtual void clear_cache() = 0;
   ```



##########
be/src/olap/rowset/rowset.h:
##########
@@ -303,6 +303,9 @@ class Rowset : public std::enable_shared_from_this<Rowset> {
 
     std::string get_rowset_info_str();
 
+    virtual void clear_inverted_index_cache() { LOG(INFO) << "should not reach 
here"; }

Review Comment:
   Move this method to `BetaRowset` private field



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to