| 1181 | } |
| 1182 | |
| 1183 | Status Flush() override { |
| 1184 | RETURN_NOT_OK(CheckClosed("flush")); |
| 1185 | if (!initialised_) { |
| 1186 | // If the stream has not been successfully initialized then there is nothing to |
| 1187 | // flush. This also avoids some unhandled errors when flushing in the destructor. |
| 1188 | return Status::OK(); |
| 1189 | } |
| 1190 | |
| 1191 | Future<> pending_blocks_completed; |
| 1192 | { |
| 1193 | std::unique_lock<std::mutex> lock(upload_state_->mutex); |
| 1194 | pending_blocks_completed = upload_state_->pending_blocks_completed; |
| 1195 | } |
| 1196 | |
| 1197 | RETURN_NOT_OK(pending_blocks_completed.status()); |
| 1198 | std::unique_lock<std::mutex> lock(upload_state_->mutex); |
| 1199 | return CommitBlockList(block_blob_client_, upload_state_->block_ids, |
| 1200 | commit_block_list_options_); |
| 1201 | } |
| 1202 | |
| 1203 | Future<> FlushAsync() { |
| 1204 | RETURN_NOT_OK(CheckClosed("flush async")); |
nothing calls this directly
no test coverage detected