| 1966 | } |
| 1967 | |
| 1968 | Status UploadUsingSingleRequest() { |
| 1969 | std::shared_ptr<Buffer> buf; |
| 1970 | if (current_part_ == nullptr) { |
| 1971 | // In case the stream is closed directly after it has been opened without writing |
| 1972 | // anything, we'll have to create an empty buffer. |
| 1973 | buf = std::make_shared<Buffer>(""); |
| 1974 | } else { |
| 1975 | ARROW_ASSIGN_OR_RAISE(buf, current_part_->Finish()); |
| 1976 | } |
| 1977 | |
| 1978 | current_part_.reset(); |
| 1979 | current_part_size_ = 0; |
| 1980 | return UploadUsingSingleRequest(buf); |
| 1981 | } |
| 1982 | |
| 1983 | template <typename RequestType, typename OutcomeType> |
| 1984 | using UploadResultCallbackFunction = |