| 1201 | } |
| 1202 | |
| 1203 | Future<> FlushAsync() { |
| 1204 | RETURN_NOT_OK(CheckClosed("flush async")); |
| 1205 | if (!initialised_) { |
| 1206 | // If the stream has not been successfully initialized then there is nothing to |
| 1207 | // flush. This also avoids some unhandled errors when flushing in the destructor. |
| 1208 | return Status::OK(); |
| 1209 | } |
| 1210 | |
| 1211 | Future<> pending_blocks_completed; |
| 1212 | { |
| 1213 | std::unique_lock<std::mutex> lock(upload_state_->mutex); |
| 1214 | pending_blocks_completed = upload_state_->pending_blocks_completed; |
| 1215 | } |
| 1216 | |
| 1217 | return pending_blocks_completed.Then([self = Self()] { |
| 1218 | std::unique_lock<std::mutex> lock(self->upload_state_->mutex); |
| 1219 | return CommitBlockList(self->block_blob_client_, self->upload_state_->block_ids, |
| 1220 | self->commit_block_list_options_); |
| 1221 | }); |
| 1222 | } |
| 1223 | |
| 1224 | private: |
| 1225 | Status AppendCurrentBlock() { |
nothing calls this directly
no test coverage detected