| 705 | } |
| 706 | |
| 707 | arrow::Result<FlightClient::DoExchangeResult> FlightClient::DoExchange( |
| 708 | const FlightCallOptions& options, const FlightDescriptor& descriptor) { |
| 709 | RETURN_NOT_OK(CheckOpen()); |
| 710 | std::unique_ptr<internal::ClientDataStream> remote_stream; |
| 711 | RETURN_NOT_OK(transport_->DoExchange(options, &remote_stream)); |
| 712 | std::shared_ptr<internal::ClientDataStream> shared_stream = std::move(remote_stream); |
| 713 | DoExchangeResult result; |
| 714 | result.reader = std::make_unique<ClientStreamReader>( |
| 715 | shared_stream, options.read_options, options.stop_token, options.memory_manager); |
| 716 | auto stream_writer = std::make_unique<ClientStreamWriter>( |
| 717 | std::move(shared_stream), options.write_options, write_size_limit_bytes_, |
| 718 | descriptor); |
| 719 | RETURN_NOT_OK(stream_writer->Begin()); |
| 720 | result.writer = std::move(stream_writer); |
| 721 | return result; |
| 722 | } |
| 723 | |
| 724 | ::arrow::Result<SetSessionOptionsResult> FlightClient::SetSessionOptions( |
| 725 | const FlightCallOptions& options, const SetSessionOptionsRequest& request) { |