| 614 | } |
| 615 | |
| 616 | Status BufferedTupleStream::PrepareForRead(bool attach_on_read, bool* got_reservation) { |
| 617 | CHECK_CONSISTENCY_FULL(read_it_); |
| 618 | InvalidateWriteIterator(); |
| 619 | InvalidateReadIterator(); |
| 620 | // If already pinned, no additional pin is needed (see ExpectedPinCount()). |
| 621 | *got_reservation = pinned_ || pages_.empty() |
| 622 | || buffer_pool_client_->IncreaseReservationToFit(default_page_len_); |
| 623 | if (!*got_reservation) return Status::OK(); |
| 624 | return PrepareForReadInternal(attach_on_read, &read_it_); |
| 625 | } |
| 626 | |
| 627 | Status BufferedTupleStream::PrepareForPinnedRead(ReadIterator* iter) { |
| 628 | DCHECK(pinned_) << "Can only read pinned stream with external iterator"; |