| 41 | } |
| 42 | |
| 43 | bool Exchange::getSplits(ContinueFuture* future) { |
| 44 | if (!processSplits_) { |
| 45 | return false; |
| 46 | } |
| 47 | if (noMoreSplits_) { |
| 48 | return false; |
| 49 | } |
| 50 | std::vector<std::string> taskIds; |
| 51 | for (;;) { |
| 52 | exec::Split split; |
| 53 | auto reason = operatorCtx_->task()->getSplitOrFuture( |
| 54 | operatorCtx_->driverCtx()->splitGroupId, planNodeId(), split, *future); |
| 55 | if (reason == BlockingReason::kNotBlocked) { |
| 56 | if (split.hasConnectorSplit()) { |
| 57 | auto remoteSplit = std::dynamic_pointer_cast<RemoteConnectorSplit>( |
| 58 | split.connectorSplit); |
| 59 | BOLT_CHECK(remoteSplit, "Wrong type of split"); |
| 60 | taskIds.push_back(remoteSplit->taskId); |
| 61 | } else { |
| 62 | addTaskIds(taskIds); |
| 63 | exchangeClient_->noMoreRemoteTasks(); |
| 64 | noMoreSplits_ = true; |
| 65 | if (atEnd_) { |
| 66 | operatorCtx_->task()->multipleSplitsFinished( |
| 67 | stats_.rlock()->numSplits); |
| 68 | recordExchangeClientStats(); |
| 69 | } |
| 70 | return false; |
| 71 | } |
| 72 | } else { |
| 73 | addTaskIds(taskIds); |
| 74 | return true; |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | BlockingReason Exchange::isBlocked(ContinueFuture* future) { |
| 80 | if (!currentPages_.empty() || atEnd_) { |
nothing calls this directly
no test coverage detected