github-actions[bot] commented on code in PR #41429: URL: https://github.com/apache/doris/pull/41429#discussion_r1796696076
########## be/src/olap/rowset/segment_v2/index_page.cpp: ########## @@ -64,6 +64,10 @@ Status IndexPageBuilder::get_first_key(Slice* key) const { /////////////////////////////////////////////////////////////////////////////// +int64_t IndexPageReader::get_metadata_size() const { Review Comment: warning: method 'get_metadata_size' can be made const [readability-make-member-function-const] ```suggestion int64_t IndexPageReader::get_metadata_size() const { ``` be/src/olap/rowset/segment_v2/index_page.h:113: ```diff - int64_t get_metadata_size() override; + int64_t get_metadata_size() const override; ``` ########## be/src/olap/rowset/segment_v2/ordinal_page_index.cpp: ########## @@ -156,13 +157,7 @@ OrdinalPageIndexIterator OrdinalIndexReader::seek_at_or_before(ordinal_t ordinal return OrdinalPageIndexIterator(this, left); } -OrdinalIndexReader::~OrdinalIndexReader() { - if (_ordinals.size() > 0) { - g_ordinal_index_memory_bytes << -sizeof(*this) - _ordinals.size() * sizeof(ordinal_t) - - _pages.size() * sizeof(PagePointer) - - sizeof(OrdinalIndexReader); - } -} +OrdinalIndexReader::~OrdinalIndexReader() = default; Review Comment: warning: use '= default' to define a trivial destructor [modernize-use-equals-default] ```suggestion OrdinalIndexReader::~OrdinalIndexReader() = default; ``` ########## be/src/olap/rowset/segment_v2/indexed_column_reader.cpp: ########## @@ -138,9 +140,7 @@ Status IndexedColumnReader::read_page(const PagePointer& pp, PageHandle* handle, return st; } -IndexedColumnReader::~IndexedColumnReader() { - g_index_reader_memory_bytes << -sizeof(*this); -} +IndexedColumnReader::~IndexedColumnReader() = default; Review Comment: warning: use '= default' to define a trivial destructor [modernize-use-equals-default] ```suggestion IndexedColumnReader::~IndexedColumnReader() = default; ``` ########## be/src/olap/rowset/segment_v2/zone_map_index.cpp: ########## @@ -177,18 +172,18 @@ Status ZoneMapIndexReader::_load(bool use_page_cache, bool kept_in_memory, column->get_data_at(0).size)) { return Status::Corruption("Failed to parse zone map"); } + _pb_meta_size += _page_zone_maps[i].ByteSizeLong(); } + update_metadata_size(); return Status::OK(); } -ZoneMapIndexReader::~ZoneMapIndexReader() { - // Maybe wrong due to load failures. - if (_page_zone_maps.size() > 0) { - g_zone_map_memory_bytes << -sizeof(*this) - sizeof(ZoneMapPB) * _page_zone_maps.size() - - sizeof(IndexedColumnMetaPB); - } +int64_t ZoneMapIndexReader::get_metadata_size() const { Review Comment: warning: method 'get_metadata_size' can be made const [readability-make-member-function-const] ```suggestion int64_t ZoneMapIndexReader::get_metadata_size() const { ``` be/src/olap/rowset/segment_v2/zone_map_index.h:165: ```diff - int64_t get_metadata_size() override; + int64_t get_metadata_size() const override; ``` -- 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