pitrou commented on a change in pull request #9678:
URL: https://github.com/apache/arrow/pull/9678#discussion_r595049739
##########
File path: cpp/src/arrow/filesystem/s3fs.cc
##########
@@ -1537,16 +1568,14 @@ class S3FileSystem::Impl {
}
req.SetBucket(ToAwsString(bucket));
req.SetDelete(std::move(del));
- delete_handlers.emplace_back();
- futures.push_back(&delete_handlers.back().future);
- client_->DeleteObjectsAsync(req, delete_handlers.back());
+ ARROW_ASSIGN_OR_RAISE(auto fut, io_context_.executor()->Submit(
+ io_context_.stop_token(), [client,
req]() {
+ return client->DeleteObjects(req);
+ }));
+ futures.push_back(std::move(fut).Then(delete_cb));
}
- WaitForAll(futures);
- for (const auto* fut : futures) {
- RETURN_NOT_OK(fut->status());
- }
- return Status::OK();
+ return AllComplete(futures).status();
Review comment:
Well, this is implementing a sync method. The FileSystem interface
doesn't have an async deletion method. We may add one, but I don't think that's
necessary for now.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]