pitrou commented on a change in pull request #9678:
URL: https://github.com/apache/arrow/pull/9678#discussion_r595053426
##########
File path: cpp/src/arrow/filesystem/s3fs.cc
##########
@@ -1035,6 +1025,26 @@ class ObjectOutputStream final : public io::OutputStream
{
return Status::OK();
}
+ static void HandleUploadOutcome(const std::shared_ptr<UploadState>& state,
+ int part_number, const
S3Model::UploadPartRequest& req,
+ const Result<S3Model::UploadPartOutcome>&
result) {
+ std::unique_lock<std::mutex> lock(state->mutex);
+ if (!result.ok()) {
+ state->status &= result.status();
+ } else {
+ const auto& outcome = *result;
+ if (!outcome.IsSuccess()) {
+ state->status &= UploadPartError(req, outcome);
+ } else {
+ AddCompletedPart(state, part_number, outcome.GetResult());
+ }
+ }
+ // Notify completion, regardless of success / error status
+ if (--state->parts_in_progress == 0) {
Review comment:
For now we're not exposing any `FlushAsync` method on `OutputStream`. I
don't know if that would later be necessary. But we can indeed prepare for it
by using a future.
----------------------------------------------------------------
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]