MCPcopy Create free account
hub / github.com/apache/arrow / StopProducing

Method StopProducing

r/src/compute-exec.cpp:172–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170 }
171
172 void StopProducing() {
173 if (plan_status_ == PLAN_RUNNING) {
174 // We're done with the plan, but it may still need some time
175 // to finish and clean up after itself. To do this, we give a
176 // callable with its own copy of the shared_ptr<ExecPlan> so
177 // that it can delete itself when it is safe to do so.
178 std::shared_ptr<arrow::acero::ExecPlan> plan(plan_);
179 bool not_finished_yet = plan_->finished().TryAddCallback(
180 [&plan] { return [plan](const arrow::Status&) {}; });
181
182 if (not_finished_yet) {
183 plan_->StopProducing();
184 }
185 }
186
187 plan_status_ = PLAN_FINISHED;
188 // A previous version of this called plan_.reset() and reset
189 // sink_gen_ to an empty generator; however, this caused
190 // crashes on some platforms.
191 }
192};
193
194// [[acero::export]]

Callers

nothing calls this directly

Calls 2

finishedMethod · 0.80
TryAddCallbackMethod · 0.45

Tested by

no test coverage detected