MCPcopy Create free account
hub / github.com/bytedance/bolt / noMoreInput

Method noMoreInput

bolt/exec/tests/CustomJoinTest.cpp:120–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118 }
119
120 void noMoreInput() override {
121 Operator::noMoreInput();
122 std::vector<ContinuePromise> promises;
123 std::vector<std::shared_ptr<Driver>> peers;
124 // The last Driver to hit CustomJoinBuild::finish gathers the data from
125 // all build Drivers and hands it over to the probe side. At this
126 // point all build Drivers are continued and will free their
127 // state. allPeersFinished is true only for the last Driver of the
128 // build pipeline.
129 if (!operatorCtx_->task()->allPeersFinished(
130 planNodeId(), operatorCtx_->driver(), &future_, promises, peers)) {
131 return;
132 }
133
134 for (auto& peer : peers) {
135 auto op = peer->findOperator(planNodeId());
136 auto* build = dynamic_cast<CustomJoinBuild*>(op);
137 BOLT_CHECK(build);
138 numRows_ += build->numRows_;
139 }
140
141 // Realize the promises so that the other Drivers (which were not
142 // the last to finish) can continue from the barrier and finish.
143 peers.clear();
144 for (auto& promise : promises) {
145 promise.setValue();
146 }
147
148 auto joinBridge = operatorCtx_->task()->getCustomJoinBridge(
149 operatorCtx_->driverCtx()->splitGroupId, planNodeId());
150 auto customJoinBridge =
151 std::dynamic_pointer_cast<CustomJoinBridge>(joinBridge);
152 customJoinBridge->setNumRows(std::make_optional(numRows_));
153 }
154
155 BlockingReason isBlocked(ContinueFuture* future) override {
156 if (!future_.valid()) {

Callers

nothing calls this directly

Calls 9

allPeersFinishedMethod · 0.80
taskMethod · 0.80
driverMethod · 0.80
findOperatorMethod · 0.80
getCustomJoinBridgeMethod · 0.80
clearMethod · 0.45
setValueMethod · 0.45
driverCtxMethod · 0.45
setNumRowsMethod · 0.45

Tested by

no test coverage detected