Advance to the next data page
| 795 | |
| 796 | // Advance to the next data page |
| 797 | bool ReadNewPage() { |
| 798 | // Loop until we find the next data page. |
| 799 | while (true) { |
| 800 | current_page_ = pager_->NextPage(); |
| 801 | if (!current_page_) { |
| 802 | // EOS |
| 803 | return false; |
| 804 | } |
| 805 | |
| 806 | if (current_page_->type() == PageType::DICTIONARY_PAGE) { |
| 807 | ConfigureDictionary(static_cast<const DictionaryPage*>(current_page_.get())); |
| 808 | continue; |
| 809 | } else if (current_page_->type() == PageType::DATA_PAGE) { |
| 810 | const auto* page = static_cast<const DataPageV1*>(current_page_.get()); |
| 811 | const int64_t levels_byte_size = InitializeLevelDecoders( |
| 812 | *page, page->repetition_level_encoding(), page->definition_level_encoding()); |
| 813 | InitializeDataDecoder(*page, levels_byte_size); |
| 814 | return true; |
| 815 | } else if (current_page_->type() == PageType::DATA_PAGE_V2) { |
| 816 | const auto* page = static_cast<const DataPageV2*>(current_page_.get()); |
| 817 | int64_t levels_byte_size = InitializeLevelDecodersV2(*page); |
| 818 | InitializeDataDecoder(*page, levels_byte_size); |
| 819 | return true; |
| 820 | } else { |
| 821 | // We don't know what this page type is. We're allowed to skip non-data |
| 822 | // pages. |
| 823 | continue; |
| 824 | } |
| 825 | } |
| 826 | return true; |
| 827 | } |
| 828 | |
| 829 | void ConfigureDictionary(const DictionaryPage* page) { |
| 830 | int encoding = static_cast<int>(page->encoding()); |
nothing calls this directly
no test coverage detected