| 47 | } |
| 48 | |
| 49 | Status SpillableRowBatchQueue::Open() { |
| 50 | // Initialize the ResevationManager and then claim the initial reservation. |
| 51 | reservation_manager_.Init(name_, profile_, state_->instance_buffer_reservation(), |
| 52 | mem_tracker_, resource_profile_, debug_options_); |
| 53 | RETURN_IF_ERROR(reservation_manager_.ClaimBufferReservation(state_)); |
| 54 | |
| 55 | // Create the BufferedTupleStream, initialize it, and then create the read and write |
| 56 | // buffer pages. |
| 57 | batch_queue_ = make_unique<BufferedTupleStream>(state_, row_desc_, |
| 58 | reservation_manager_.buffer_pool_client(), resource_profile_.spillable_buffer_size, |
| 59 | resource_profile_.max_row_buffer_size); |
| 60 | RETURN_IF_ERROR(batch_queue_->Init(name_, true)); |
| 61 | bool got_reservation = false; |
| 62 | RETURN_IF_ERROR(batch_queue_->PrepareForReadWrite(true, &got_reservation)); |
| 63 | DCHECK(got_reservation) << "SpillableRowBatchQueue failed to get reservation using " |
| 64 | << "buffer pool client: " |
| 65 | << reservation_manager_.buffer_pool_client()->DebugString(); |
| 66 | return Status::OK(); |
| 67 | } |
| 68 | |
| 69 | Status SpillableRowBatchQueue::AddBatch(RowBatch* batch) { |
| 70 | DCHECK(!IsFull()) << "Cannot AddBatch on a full SpillableRowBatchQueue"; |
nothing calls this directly
no test coverage detected