| 1842 | } |
| 1843 | |
| 1844 | Status Close() override { |
| 1845 | if (closed_) return Status::OK(); |
| 1846 | |
| 1847 | RETURN_NOT_OK(CleanupIfFailed(EnsureReadyToFlushFromClose())); |
| 1848 | |
| 1849 | RETURN_NOT_OK(CleanupIfFailed(Flush())); |
| 1850 | |
| 1851 | if (IsMultipartCreated()) { |
| 1852 | RETURN_NOT_OK(CleanupIfFailed(FinishPartUploadAfterFlush())); |
| 1853 | } |
| 1854 | |
| 1855 | return CleanupAfterClose(); |
| 1856 | } |
| 1857 | |
| 1858 | Future<> CloseAsync() override { |
| 1859 | if (closed_) return Status::OK(); |