| 115 | } |
| 116 | |
| 117 | std::optional<HashJoinBridge::HashBuildResult> HashJoinBridge::tableOrFuture( |
| 118 | ContinueFuture* future) { |
| 119 | std::lock_guard<std::mutex> l(mutex_); |
| 120 | BOLT_CHECK(started_); |
| 121 | BOLT_CHECK(!cancelled_, "Getting hash table after join is aborted"); |
| 122 | BOLT_CHECK( |
| 123 | !buildResult_.has_value() || |
| 124 | (!restoringSpillPartitionId_.has_value() && |
| 125 | restoringSpillShards_.empty())); |
| 126 | |
| 127 | if (buildResult_.has_value()) { |
| 128 | return buildResult_.value(); |
| 129 | } |
| 130 | promises_.emplace_back("HashJoinBridge::tableOrFuture"); |
| 131 | *future = promises_.back().getSemiFuture(); |
| 132 | return std::nullopt; |
| 133 | } |
| 134 | |
| 135 | bool HashJoinBridge::probeFinished() { |
| 136 | std::vector<ContinuePromise> promises; |