Skip to content

Commit

Permalink
Fix OrdinalPageIndex header size (apache#1938)
Browse files Browse the repository at this point in the history
  • Loading branch information
kangkaisen authored and imay committed Oct 9, 2019
1 parent 1c99e88 commit a6b843c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions be/src/olap/rowset/segment_v2/ordinal_page_index.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a6b843c

Please sign in to comment.