File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4646#ifndef NDEBUG
4747# include " arrow/compute/function_internal.h"
4848#endif
49+ #include " arrow/acero/backpressure.h"
4950#include " arrow/acero/time_series_util.h"
5051#include " arrow/compute/key_hash_internal.h"
5152#include " arrow/compute/light_array_internal.h"
@@ -459,21 +460,6 @@ class KeyHasher {
459460 arrow::util::TempVectorStack stack_;
460461};
461462
462- class BackpressureController : public BackpressureControl {
463- public:
464- BackpressureController (ExecNode* node, ExecNode* output,
465- std::atomic<int32_t >& backpressure_counter)
466- : node_(node), output_(output), backpressure_counter_(backpressure_counter) {}
467-
468- void Pause () override { node_->PauseProducing (output_, ++backpressure_counter_); }
469- void Resume () override { node_->ResumeProducing (output_, ++backpressure_counter_); }
470-
471- private:
472- ExecNode* node_;
473- ExecNode* output_;
474- std::atomic<int32_t >& backpressure_counter_;
475- };
476-
477463class InputState : public util ::SerialSequencingQueue::Processor {
478464 // InputState corresponds to an input
479465 // Input record batches are queued up in InputState until processed and
Original file line number Diff line number Diff line change 1616// under the License.
1717
1818#include " arrow/acero/backpressure.h"
19+ #include " arrow/acero/exec_plan.h"
20+
1921namespace arrow ::acero {
22+ BackpressureController::BackpressureController (ExecNode* node, ExecNode* output,
23+ std::atomic<int32_t >& backpressure_counter)
24+ : node_(node), output_(output), backpressure_counter_(backpressure_counter) {}
25+ void BackpressureController::Pause () {
26+ node_->PauseProducing (output_, ++backpressure_counter_);
27+ }
28+ void BackpressureController::Resume () {
29+ node_->ResumeProducing (output_, ++backpressure_counter_);
30+ }
31+
2032BackpressureCombiner::BackpressureCombiner (
2133 std::unique_ptr<BackpressureControl> backpressure_control)
2234 : backpressure_control_(std::move(backpressure_control)) {}
Original file line number Diff line number Diff line change 2121#include < mutex>
2222namespace arrow ::acero {
2323
24+ // Generic backpressure controller for ExecNode
25+ class BackpressureController : public BackpressureControl {
26+ public:
27+ BackpressureController (ExecNode* node, ExecNode* output,
28+ std::atomic<int32_t >& backpressure_counter);
29+
30+ void Pause () override ;
31+ void Resume () override ;
32+
33+ private:
34+ ExecNode* node_;
35+ ExecNode* output_;
36+ std::atomic<int32_t >& backpressure_counter_;
37+ };
38+
2439// Provides infrastructure of combining multiple backpressure sources and propagate the
2540// result into BackpressureControl There are two types of Source: strong - pause on any
2641// strong Source within controller
Original file line number Diff line number Diff line change 2727#include < vector>
2828
2929#include " arrow/acero/accumulation_queue.h"
30+ #include " arrow/acero/backpressure.h"
3031#include " arrow/acero/concurrent_queue.h"
3132#include " arrow/acero/exec_plan.h"
3233#include " arrow/acero/exec_plan_internal.h"
@@ -86,21 +87,6 @@ using col_index_t = int;
8687constexpr bool kNewTask = true ;
8788constexpr bool kPoisonPill = false ;
8889
89- class BackpressureController : public BackpressureControl {
90- public:
91- BackpressureController (ExecNode* node, ExecNode* output,
92- std::atomic<int32_t >& backpressure_counter)
93- : node_(node), output_(output), backpressure_counter_(backpressure_counter) {}
94-
95- void Pause () override { node_->PauseProducing (output_, ++backpressure_counter_); }
96- void Resume () override { node_->ResumeProducing (output_, ++backpressure_counter_); }
97-
98- private:
99- ExecNode* node_;
100- ExecNode* output_;
101- std::atomic<int32_t >& backpressure_counter_;
102- };
103-
10490// / InputState corresponds to an input. Input record batches are queued up in InputState
10591// / until processed and turned into output record batches.
10692class InputState : public util ::SerialSequencingQueue::Processor {
You can’t perform that action at this time.
0 commit comments