| 198 | } |
| 199 | |
| 200 | void BufferedTupleStream::Page::AttachBufferToBatch( |
| 201 | BufferedTupleStream* parent, RowBatch* batch, FlushMode flush) { |
| 202 | DCHECK(is_pinned()); |
| 203 | DCHECK(retrieved_buffer.Load()); |
| 204 | parent->bytes_pinned_ -= len(); |
| 205 | // ExtractBuffer() cannot fail because the buffer is already in memory. |
| 206 | BufferPool::BufferHandle buffer; |
| 207 | Status status = |
| 208 | parent->buffer_pool_->ExtractBuffer(parent->buffer_pool_client_, &handle, &buffer); |
| 209 | DCHECK(status.ok()); |
| 210 | batch->AddBuffer(parent->buffer_pool_client_, move(buffer), flush); |
| 211 | attached_to_output_batch = true; |
| 212 | } |
| 213 | |
| 214 | string BufferedTupleStream::Page::DebugString() const { |
| 215 | return Substitute("$0 num_rows=$1 retrieved_buffer=$2 attached_to_output_batch=$3", |
no test coverage detected