You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/28 21:35:46 UTC

[GitHub] [arrow] westonpace commented on a change in pull request #12720: ARROW-15994: [C++] Back out taskify changes

westonpace commented on a change in pull request #12720:
URL: https://github.com/apache/arrow/pull/12720#discussion_r836868243



##########
File path: cpp/src/arrow/compute/exec/exec_plan.cc
##########
@@ -436,22 +436,11 @@ void MapNode::SubmitTask(std::function<Result<ExecBatch>(ExecBatch)> map_fn,
     return Status::OK();
   };
 
-  if (executor_) {
-    status = task_group_.AddTask([this, task]() -> Result<Future<>> {
-      return this->executor_->Submit(this->stop_source_.token(), [this, task]() {
-        auto status = task();
-        if (this->input_counter_.Increment()) {
-          this->Finish(status);
-        }
-        return status;
-      });
-    });
-  } else {
-    status = task();
-    if (input_counter_.Increment()) {
-      this->Finish(status);
-    }
+  status = task();
+  if (input_counter_.Increment()) {

Review comment:
       I think it's slightly clearer to readers if this check comes after the `if (!status.ok())` check.  Then we can just do...
   
   ```
   if (input_counter_.Increment()) {
     this->Finish();
   }
   ```

##########
File path: cpp/src/arrow/compute/exec/exec_plan.cc
##########
@@ -436,22 +436,11 @@ void MapNode::SubmitTask(std::function<Result<ExecBatch>(ExecBatch)> map_fn,
     return Status::OK();
   };
 
-  if (executor_) {
-    status = task_group_.AddTask([this, task]() -> Result<Future<>> {
-      return this->executor_->Submit(this->stop_source_.token(), [this, task]() {
-        auto status = task();
-        if (this->input_counter_.Increment()) {
-          this->Finish(status);
-        }
-        return status;
-      });
-    });
-  } else {
-    status = task();
-    if (input_counter_.Increment()) {
-      this->Finish(status);
-    }
+  status = task();
+  if (input_counter_.Increment()) {
+    this->Finish(status);
   }
+
   // If we get a cancelled status from AddTask it means this node was stopped
   // or errored out already so we can just drop the task.
   if (!status.ok() && !status.IsCancelled()) {

Review comment:
       We don't need the comment (or the check for `!status.IsCancelled`) anymore.




-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org