From a6b843c04d4a194b1ef44639f64f4640ec5a22a9 Mon Sep 17 00:00:00 2001 From: kangkaisen Date: Wed, 9 Oct 2019 22:07:27 +0800 Subject: [PATCH] Fix OrdinalPageIndex header size (#1938) --- be/src/olap/rowset/segment_v2/ordinal_page_index.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/be/src/olap/rowset/segment_v2/ordinal_page_index.h b/be/src/olap/rowset/segment_v2/ordinal_page_index.h index 95461b7e9cd7c4..4c39c8ff6f75d3 100644 --- a/be/src/olap/rowset/segment_v2/ordinal_page_index.h +++ b/be/src/olap/rowset/segment_v2/ordinal_page_index.h @@ -39,12 +39,15 @@ namespace segment_v2 { // index_pair: // Ordinal (4 Bytes) // PagePointer (8 Bytes) + +static const uint32_t ORDINAL_PAGE_INDEX_HEADER_SIZE = 4; + class OrdinalPageIndexBuilder { public: OrdinalPageIndexBuilder() : _num_pages(0) { _buffer.reserve(4 * 1024); // reserve space for number of pages - _buffer.resize(4); + _buffer.resize(ORDINAL_PAGE_INDEX_HEADER_SIZE); } void append_entry(rowid_t rid, const PagePointer& page) { @@ -119,7 +122,7 @@ class OrdinalPageIndex { } private: - uint32_t _header_size() const { return 8; } + uint32_t _header_size() const { return ORDINAL_PAGE_INDEX_HEADER_SIZE; } private: friend OrdinalPageIndexIterator;