| 1707 | } |
| 1708 | |
| 1709 | Status CreateMultipartUpload() { |
| 1710 | DCHECK(ShouldBeMultipartUpload()); |
| 1711 | |
| 1712 | ARROW_ASSIGN_OR_RAISE(auto client_lock, holder_->Lock()); |
| 1713 | |
| 1714 | // Initiate the multi-part upload |
| 1715 | S3Model::CreateMultipartUploadRequest req; |
| 1716 | req.SetBucket(ToAwsString(path_.bucket)); |
| 1717 | req.SetKey(ToAwsString(path_.key)); |
| 1718 | RETURN_NOT_OK(SetSSECustomerKey(&req, sse_customer_key_)); |
| 1719 | RETURN_NOT_OK(SetMetadataInRequest(&req)); |
| 1720 | |
| 1721 | auto outcome = client_lock.Move()->CreateMultipartUpload(req); |
| 1722 | if (!outcome.IsSuccess()) { |
| 1723 | return ErrorToStatus( |
| 1724 | std::forward_as_tuple("When initiating multiple part upload for key '", |
| 1725 | path_.key, "' in bucket '", path_.bucket, "': "), |
| 1726 | "CreateMultipartUpload", outcome.GetError()); |
| 1727 | } |
| 1728 | multipart_upload_id_ = outcome.GetResult().GetUploadId(); |
| 1729 | |
| 1730 | return Status::OK(); |
| 1731 | } |
| 1732 | |
| 1733 | Status Init() { |
| 1734 | // If we are allowed to do delayed I/O, we can use a single request to upload the |
nothing calls this directly
no test coverage detected