This is an automated email from the ASF dual-hosted git repository. dataroaring pushed a commit to branch branch-2.0-clear-fd in repository https://gitbox.apache.org/repos/asf/doris.git
commit 29a06f0c576e232c1996a11555382ece306817ce Author: Yongqiang YANG <dataroar...@gmail.com> AuthorDate: Wed Apr 24 12:05:16 2024 +0800 fix --- be/src/olap/rowset/beta_rowset.cpp | 13 +++++++++++++ be/src/olap/rowset/beta_rowset.h | 2 ++ be/src/olap/rowset/rowset.cpp | 13 ------------- be/src/olap/rowset/rowset.h | 2 +- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/be/src/olap/rowset/beta_rowset.cpp b/be/src/olap/rowset/beta_rowset.cpp index 0846db3a2fd..93874c5616b 100644 --- a/be/src/olap/rowset/beta_rowset.cpp +++ b/be/src/olap/rowset/beta_rowset.cpp @@ -488,4 +488,17 @@ Status BetaRowset::add_to_binlog() { return Status::OK(); } +void Rowset::clear_cache() { + SegmentCache::CacheKey cache_key(rowset_id()); + SegmentLoader::instance()->erase_segments(cache_key); + clear_inverted_index_cache(); + for (int i = 0; i < num_segments(); ++i) { + auto seg_path = segment_file_path(i); + if (fs->type() != io::FileSystemType::LOCAL) { + auto cache_path = segment_cache_path(i); + FileCacheManager::instance()->remove_file_cache(cache_path); + } + } +} + } // namespace doris diff --git a/be/src/olap/rowset/beta_rowset.h b/be/src/olap/rowset/beta_rowset.h index e9e749e5e9c..f4496457183 100644 --- a/be/src/olap/rowset/beta_rowset.h +++ b/be/src/olap/rowset/beta_rowset.h @@ -98,6 +98,8 @@ public: [[nodiscard]] virtual Status add_to_binlog() override; + void clear_cache() override; + protected: BetaRowset(const TabletSchemaSPtr& schema, const std::string& tablet_path, const RowsetMetaSharedPtr& rowset_meta); diff --git a/be/src/olap/rowset/rowset.cpp b/be/src/olap/rowset/rowset.cpp index 8559921beff..0872149a68f 100644 --- a/be/src/olap/rowset/rowset.cpp +++ b/be/src/olap/rowset/rowset.cpp @@ -95,17 +95,4 @@ void Rowset::merge_rowset_meta(const RowsetMetaSharedPtr& other) { } } -void Rowset::clear_cache() { - SegmentCache::CacheKey cache_key(rowset_id()); - SegmentLoader::instance()->erase_segments(cache_key); - clear_inverted_index_cache(); - for (int i = 0; i < num_segments(); ++i) { - auto seg_path = segment_file_path(i); - if (fs->type() != io::FileSystemType::LOCAL) { - auto cache_path = segment_cache_path(i); - FileCacheManager::instance()->remove_file_cache(cache_path); - } - } -} - } // namespace doris diff --git a/be/src/olap/rowset/rowset.h b/be/src/olap/rowset/rowset.h index 7d0be1abab1..4a5568e6931 100644 --- a/be/src/olap/rowset/rowset.h +++ b/be/src/olap/rowset/rowset.h @@ -313,7 +313,7 @@ public: void set_skip_index_compaction(int32_t column_id) { skip_index_compaction.insert(column_id); } virtual void clear_inverted_index_cache() { LOG(INFO) << "should not reach here"; } - void clear_cache(); + virtual void clear_cache(); protected: friend class RowsetFactory; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org