| 95 | } |
| 96 | |
| 97 | Status BufferPool::PageHandle::GetBuffer(const BufferHandle** buffer) const { |
| 98 | DCHECK(is_open()); |
| 99 | DCHECK(client_->is_registered()); |
| 100 | DCHECK(is_pinned()); |
| 101 | // Dirty check to see if we might need to wait for the pin to finish (this |
| 102 | // avoids the lock acquisition in the common case). |
| 103 | if (page_->pin_in_flight.Load()) { |
| 104 | // Finish the work started in Pin(). |
| 105 | RETURN_IF_ERROR(client_->impl_->FinishMoveEvictedToPinned(page_)); |
| 106 | } |
| 107 | DCHECK(!page_->pin_in_flight.Load()); |
| 108 | *buffer = &page_->buffer; |
| 109 | DCHECK((*buffer)->is_open()); |
| 110 | return Status::OK(); |
| 111 | } |
| 112 | |
| 113 | BufferPool::BufferPool(MetricGroup* metrics, int64_t min_buffer_len, |
| 114 | int64_t buffer_bytes_limit, int64_t clean_page_bytes_limit) |