| 1733 | } |
| 1734 | |
| 1735 | Status Init() { |
| 1736 | // If we are allowed to do delayed I/O, we can use a single request to upload the |
| 1737 | // data. If not, we use a multi-part upload and initiate it here to |
| 1738 | // sanitize that writing to the bucket is possible. |
| 1739 | if (!allow_delayed_open_) { |
| 1740 | RETURN_NOT_OK(CreateMultipartUpload()); |
| 1741 | } |
| 1742 | |
| 1743 | upload_state_ = std::make_shared<UploadState>(); |
| 1744 | closed_ = false; |
| 1745 | return Status::OK(); |
| 1746 | } |
| 1747 | |
| 1748 | Status Abort() override { |
| 1749 | if (closed_) { |