Echo client data, but with write options set to limit the nesting level.
| 1078 | // Echo client data, but with write options set to limit the nesting |
| 1079 | // level. |
| 1080 | Status DoExchange(const ServerCallContext& context, |
| 1081 | std::unique_ptr<FlightMessageReader> reader, |
| 1082 | std::unique_ptr<FlightMessageWriter> writer) override { |
| 1083 | auto options = ipc::IpcWriteOptions::Defaults(); |
| 1084 | options.max_recursion_depth = 1; |
| 1085 | bool begun = false; |
| 1086 | while (true) { |
| 1087 | ARROW_ASSIGN_OR_RAISE(FlightStreamChunk chunk, reader->Next()); |
| 1088 | if (!chunk.data && !chunk.app_metadata) { |
| 1089 | break; |
| 1090 | } |
| 1091 | if (!begun && chunk.data) { |
| 1092 | begun = true; |
| 1093 | RETURN_NOT_OK(writer->Begin(chunk.data->schema(), options)); |
| 1094 | } |
| 1095 | if (chunk.data && chunk.app_metadata) { |
| 1096 | RETURN_NOT_OK(writer->WriteWithMetadata(*chunk.data, chunk.app_metadata)); |
| 1097 | } else if (chunk.data) { |
| 1098 | RETURN_NOT_OK(writer->WriteRecordBatch(*chunk.data)); |
| 1099 | } else if (chunk.app_metadata) { |
| 1100 | RETURN_NOT_OK(writer->WriteMetadata(chunk.app_metadata)); |
| 1101 | } |
| 1102 | } |
| 1103 | return Status::OK(); |
| 1104 | } |
| 1105 | }; |
| 1106 | |
| 1107 | void IpcOptionsTest::SetUpTest() { |
nothing calls this directly
no test coverage detected