MCPcopy Create free account
hub / github.com/apache/arrow / RunExchangeEcho

Method RunExchangeEcho

cpp/src/arrow/flight/test_flight_server.cc:314–336  ·  view source on GitHub ↗

Echo the client's messages back.

Source from the content-addressed store, hash-verified

312
313// Echo the client's messages back.
314Status TestFlightServer::RunExchangeEcho(std::unique_ptr<FlightMessageReader> reader,
315 std::unique_ptr<FlightMessageWriter> writer) {
316 FlightStreamChunk chunk;
317 bool begun = false;
318 while (true) {
319 ARROW_ASSIGN_OR_RAISE(chunk, reader->Next());
320 if (!chunk.data && !chunk.app_metadata) {
321 break;
322 }
323 if (!begun && chunk.data) {
324 begun = true;
325 RETURN_NOT_OK(writer->Begin(chunk.data->schema()));
326 }
327 if (chunk.data && chunk.app_metadata) {
328 RETURN_NOT_OK(writer->WriteWithMetadata(*chunk.data, chunk.app_metadata));
329 } else if (chunk.data) {
330 RETURN_NOT_OK(writer->WriteRecordBatch(*chunk.data));
331 } else if (chunk.app_metadata) {
332 RETURN_NOT_OK(writer->WriteMetadata(chunk.app_metadata));
333 }
334 }
335 return Status::OK();
336}
337
338// Regression test for ARROW-13253
339Status TestFlightServer::RunExchangeLargeBatch(

Callers

nothing calls this directly

Calls 8

ARROW_ASSIGN_OR_RAISEFunction · 0.70
OKFunction · 0.50
NextMethod · 0.45
BeginMethod · 0.45
schemaMethod · 0.45
WriteWithMetadataMethod · 0.45
WriteRecordBatchMethod · 0.45
WriteMetadataMethod · 0.45

Tested by

no test coverage detected