save-buffer commented on code in PR #13143:
URL: https://github.com/apache/arrow/pull/13143#discussion_r918344951
##########
cpp/src/arrow/compute/exec/exec_plan.h:
##########
@@ -61,6 +61,63 @@ class ARROW_EXPORT ExecPlan : public
std::enable_shared_from_this<ExecPlan> {
return out;
}
+ /// \brief Returns the index of the current thread.
+ size_t GetThreadIndex();
+ /// \brief Returns the maximum number of threads that the plan could use.
+ ///
+ /// GetThreadIndex will always return something less than this, so it is
safe to
+ /// e.g. make an array of thread-locals off this.
+ size_t max_concurrency() const;
+
+ // The below API interfaces with the scheduler to add tasks to the task
group. Tasks
+ // should be added sparingly! Prefer just doing the work immediately rather
than adding
+ // a task for it. Tasks are used in pipeline breakers that may output many
more rows
+ // than they received (such as a full outer join).
+ //
+ //
+ /// \brief Adds a future to the plan's task group.
+ ///
+ /// \param fut The future to add
+ ///
+ /// Use this when interfacing with anything that returns a future (such as
IO), but
+ /// prefer ScheduleTask/StartTaskGroup inside of
+ /// ExecNodes.
+ Status AddFuture(Future<> fut);
+
+ /// \brief Adds a single function as a task to the plan's task group.
+ ///
+ /// \param fn The task to run. Takes no arguments and returns a Status.
+ Status ScheduleTask(std::function<Status()> fn);
+
+ /// \brief Adds a single function as a task to the plan's task group.
+ ///
+ /// \param fn The task to run. Takes the thread index and returns a Status.
+ Status ScheduleTask(std::function<Status(size_t)> fn);
Review Comment:
Nope, these are just used for spawning general tasks within the plan.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]