| 348 | } |
| 349 | |
| 350 | Status Sorter::Run::FinalizePages(vector<Page>* pages) { |
| 351 | DCHECK_GT(pages->size(), 0); |
| 352 | Page* last_page = &pages->back(); |
| 353 | if (last_page->valid_data_len() > 0) { |
| 354 | DCHECK_EQ(initial_run_, is_pinned_); |
| 355 | if (!is_pinned_) { |
| 356 | // Unpin the last page of this unpinned run. We've finished writing the run so |
| 357 | // all pages in the run can now be unpinned. |
| 358 | last_page->Unpin(sorter_->buffer_pool_client_); |
| 359 | } |
| 360 | } else { |
| 361 | last_page->Close(sorter_->buffer_pool_client_); |
| 362 | pages->pop_back(); |
| 363 | } |
| 364 | return Status::OK(); |
| 365 | } |
| 366 | |
| 367 | void Sorter::Run::CloseAllPages() { |
| 368 | DeleteAndClearPages(&fixed_len_pages_); |
nothing calls this directly
no test coverage detected