| 867 | } |
| 868 | |
| 869 | Status FlightSqlServerBase::DoAction(const ServerCallContext& context, |
| 870 | const Action& action, |
| 871 | std::unique_ptr<ResultStream>* result_stream) { |
| 872 | std::vector<Result> results; |
| 873 | if (action.type == ActionType::kCancelFlightInfo.type) { |
| 874 | std::string_view body(*action.body); |
| 875 | ARROW_ASSIGN_OR_RAISE(auto request, CancelFlightInfoRequest::Deserialize(body)); |
| 876 | ARROW_ASSIGN_OR_RAISE(auto result, CancelFlightInfo(context, request)); |
| 877 | ARROW_ASSIGN_OR_RAISE(auto packed_result, PackActionResult(std::move(result))); |
| 878 | |
| 879 | results.push_back(std::move(packed_result)); |
| 880 | } else if (action.type == ActionType::kRenewFlightEndpoint.type) { |
| 881 | std::string_view body(*action.body); |
| 882 | ARROW_ASSIGN_OR_RAISE(auto request, RenewFlightEndpointRequest::Deserialize(body)); |
| 883 | ARROW_ASSIGN_OR_RAISE(auto renewed_endpoint, RenewFlightEndpoint(context, request)); |
| 884 | ARROW_ASSIGN_OR_RAISE(auto packed_result, PackActionResult(renewed_endpoint)); |
| 885 | |
| 886 | results.push_back(std::move(packed_result)); |
| 887 | } else if (action.type == ActionType::kSetSessionOptions.type) { |
| 888 | std::string_view body(*action.body); |
| 889 | ARROW_ASSIGN_OR_RAISE(auto request, SetSessionOptionsRequest::Deserialize(body)); |
| 890 | ARROW_ASSIGN_OR_RAISE(auto result, SetSessionOptions(context, request)); |
| 891 | ARROW_ASSIGN_OR_RAISE(auto packed_result, result.SerializeToBuffer()); |
| 892 | |
| 893 | results.emplace_back(std::move(packed_result)); |
| 894 | } else if (action.type == ActionType::kGetSessionOptions.type) { |
| 895 | std::string_view body(*action.body); |
| 896 | ARROW_ASSIGN_OR_RAISE(auto request, GetSessionOptionsRequest::Deserialize(body)); |
| 897 | ARROW_ASSIGN_OR_RAISE(auto result, GetSessionOptions(context, request)); |
| 898 | ARROW_ASSIGN_OR_RAISE(auto packed_result, result.SerializeToBuffer()); |
| 899 | |
| 900 | results.emplace_back(std::move(packed_result)); |
| 901 | } else if (action.type == ActionType::kCloseSession.type) { |
| 902 | std::string_view body(*action.body); |
| 903 | ARROW_ASSIGN_OR_RAISE(auto request, CloseSessionRequest::Deserialize(body)); |
| 904 | ARROW_ASSIGN_OR_RAISE(auto result, CloseSession(context, request)); |
| 905 | ARROW_ASSIGN_OR_RAISE(auto packed_result, result.SerializeToBuffer()); |
| 906 | |
| 907 | results.emplace_back(std::move(packed_result)); |
| 908 | } else { |
| 909 | if (action.type == FlightSqlServerBase::kBeginSavepointActionType.type) { |
| 910 | ARROW_ASSIGN_OR_RAISE(ActionBeginSavepointRequest internal_command, |
| 911 | ParseActionBeginSavepointRequest(action)); |
| 912 | ARROW_ASSIGN_OR_RAISE(ActionBeginSavepointResult result, |
| 913 | BeginSavepoint(context, internal_command)); |
| 914 | ARROW_ASSIGN_OR_RAISE(Result packed_result, PackActionResult(std::move(result))); |
| 915 | |
| 916 | results.push_back(std::move(packed_result)); |
| 917 | } else if (action.type == FlightSqlServerBase::kBeginTransactionActionType.type) { |
| 918 | ARROW_ASSIGN_OR_RAISE(ActionBeginTransactionRequest internal_command, |
| 919 | ParseActionBeginTransactionRequest(action)); |
| 920 | ARROW_ASSIGN_OR_RAISE(ActionBeginTransactionResult result, |
| 921 | BeginTransaction(context, internal_command)); |
| 922 | ARROW_ASSIGN_OR_RAISE(Result packed_result, PackActionResult(std::move(result))); |
| 923 | |
| 924 | results.push_back(std::move(packed_result)); |
| 925 | } else if (action.type == FlightSqlServerBase::kCancelQueryActionType.type) { |
| 926 | ARROW_ASSIGN_OR_RAISE(ActionCancelQueryRequest internal_command, |
no test coverage detected