| 1783 | } |
| 1784 | |
| 1785 | Status Close() override { |
| 1786 | if (closed_) return Status::OK(); |
| 1787 | |
| 1788 | RETURN_NOT_OK(CleanupIfFailed(EnsureReadyToFlushFromClose())); |
| 1789 | |
| 1790 | RETURN_NOT_OK(CleanupIfFailed(Flush())); |
| 1791 | |
| 1792 | if (IsMultipartCreated()) { |
| 1793 | RETURN_NOT_OK(CleanupIfFailed(FinishPartUploadAfterFlush())); |
| 1794 | } |
| 1795 | |
| 1796 | return CleanupAfterClose(); |
| 1797 | } |
| 1798 | |
| 1799 | Future<> CloseAsync() override { |
| 1800 | if (closed_) return Status::OK(); |