airborne12 commented on code in PR #20116: URL: https://github.com/apache/doris/pull/20116#discussion_r1208012307
########## be/src/olap/rowset/segment_v2/inverted_index_reader.h: ########## @@ -78,76 +78,72 @@ enum class InvertedIndexQueryType { class InvertedIndexReader { public: explicit InvertedIndexReader(io::FileSystemSPtr fs, const std::string& path, - const uint32_t index_id) - : _fs(std::move(fs)), _path(path), _index_id(index_id) {} + const TabletIndex* index_meta) + : _fs(std::move(fs)), _path(path), _index_meta(*index_meta) {} virtual ~InvertedIndexReader() = default; // create a new column iterator. Client should delete returned iterator - virtual Status new_iterator(const TabletIndex* index_meta, OlapReaderStatistics* stats, - InvertedIndexIterator** iterator) = 0; + virtual Status new_iterator(OlapReaderStatistics* stats, InvertedIndexIterator** iterator) = 0; virtual Status query(OlapReaderStatistics* stats, const std::string& column_name, const void* query_value, InvertedIndexQueryType query_type, - InvertedIndexParserType analyser_type, roaring::Roaring* bit_map) = 0; + roaring::Roaring* bit_map) = 0; virtual Status try_query(OlapReaderStatistics* stats, const std::string& column_name, const void* query_value, InvertedIndexQueryType query_type, - InvertedIndexParserType analyser_type, uint32_t* count) = 0; + uint32_t* count) = 0; Status read_null_bitmap(InvertedIndexQueryCacheHandle* cache_handle, lucene::store::Directory* dir = nullptr); virtual InvertedIndexReaderType type() = 0; bool indexExists(io::Path& index_file_path); - uint32_t get_index_id() const { return _index_id; } + uint32_t get_index_id() const { return _index_meta.index_id(); } protected: bool _is_match_query(InvertedIndexQueryType query_type); friend class InvertedIndexIterator; io::FileSystemSPtr _fs; std::string _path; - uint32_t _index_id; + TabletIndex _index_meta; Review Comment: use copy constructor, do not worry about life cycle -- 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