Advance to the next data page
| 688 | |
| 689 | // Advance to the next data page |
| 690 | bool ReadNewPage() { |
| 691 | // Loop until we find the next data page. |
| 692 | while (true) { |
| 693 | current_page_ = pager_->NextPage(); |
| 694 | if (!current_page_) { |
| 695 | // EOS |
| 696 | return false; |
| 697 | } |
| 698 | |
| 699 | if (current_page_->type() == PageType::DICTIONARY_PAGE) { |
| 700 | ConfigureDictionary(static_cast<const DictionaryPage*>(current_page_.get())); |
| 701 | continue; |
| 702 | } else if (current_page_->type() == PageType::DATA_PAGE) { |
| 703 | const auto* page = static_cast<const DataPageV1*>(current_page_.get()); |
| 704 | const int64_t levels_byte_size = InitializeLevelDecoders( |
| 705 | *page, page->repetition_level_encoding(), page->definition_level_encoding()); |
| 706 | InitializeDataDecoder(*page, levels_byte_size); |
| 707 | return true; |
| 708 | } else if (current_page_->type() == PageType::DATA_PAGE_V2) { |
| 709 | const auto* page = static_cast<const DataPageV2*>(current_page_.get()); |
| 710 | int64_t levels_byte_size = InitializeLevelDecodersV2(*page); |
| 711 | InitializeDataDecoder(*page, levels_byte_size); |
| 712 | return true; |
| 713 | } else { |
| 714 | // We don't know what this page type is. We're allowed to skip non-data |
| 715 | // pages. |
| 716 | continue; |
| 717 | } |
| 718 | } |
| 719 | return true; |
| 720 | } |
| 721 | |
| 722 | void ConfigureDictionary(const DictionaryPage* page) { |
| 723 | int encoding = static_cast<int>(page->encoding()); |
nothing calls this directly
no test coverage detected