| 688 | } |
| 689 | |
| 690 | Status PhjBuilder::TransferProbeStreamReservation( |
| 691 | BufferPool::ClientHandle* probe_client) { |
| 692 | DCHECK_EQ(is_separate_build_, probe_client != buffer_pool_client_); |
| 693 | int64_t probe_reservation = CalcProbeStreamReservation(state_); |
| 694 | VLOG(3) << "PHJ(node_id=" << join_node_id_ << ") will transfer " << probe_reservation |
| 695 | << " to probe client."; |
| 696 | if (probe_reservation == 0) return Status::OK(); |
| 697 | DCHECK_GE(probe_stream_reservation_.GetReservation(), probe_reservation); |
| 698 | |
| 699 | buffer_pool_client_->RestoreReservation(&probe_stream_reservation_, probe_reservation); |
| 700 | if (is_separate_build_) { |
| 701 | bool success; |
| 702 | RETURN_IF_ERROR(buffer_pool_client_->TransferReservationTo( |
| 703 | probe_client, probe_reservation, &success)); |
| 704 | DCHECK(success) << "Transferring within query shouldn't violate reservation limits."; |
| 705 | } |
| 706 | return Status::OK(); |
| 707 | } |
| 708 | |
| 709 | int64_t PhjBuilder::CalcProbeStreamReservation(HashJoinState next_state) const { |
| 710 | // We need a read buffer if the input is a spilled partition (i.e. we are repartitioning |
nothing calls this directly
no test coverage detected