Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OrdinalPageIndex header size #1938

Merged
merged 1 commit into from
Oct 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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