lidavidm commented on code in PR #12228: URL: https://github.com/apache/arrow/pull/12228#discussion_r856185741
########## cpp/src/arrow/compute/exec/sink_node.cc: ########## @@ -103,6 +157,28 @@ class SinkNode : public ExecNode { Future<> finished() override { return finished_; } + void RecordBackpressureBytesUsed(const ExecBatch& batch) { + if (backpressure_queue_->enabled()) { + uint64_t bytes_used = static_cast<uint64_t>(batch.TotalBufferSize()); + auto state_change = backpressure_queue_->RecordProduced(bytes_used); + if (state_change >= 0) { + EVENT(span_, "Backpressure applied", {{"counter", state_change}}); Review Comment: That works, I was thinking `arrow....` like in the memory PR but it's not a big deal. ########## cpp/src/arrow/compute/exec/hash_join_node.cc: ########## @@ -593,9 +593,13 @@ class HashJoinNode : public ExecNode { return Status::OK(); } - void PauseProducing(ExecNode* output) override { EVENT(span_, "PauseProducing"); } + void PauseProducing(ExecNode* output, int32_t counter) override { + // TODO(ARROW-16246) Review Comment: Ah, that's fair. We can leave it out. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org