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

Method DoExchange

cpp/src/arrow/flight/test_definitions.cc:1260–1279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1258 }
1259
1260 Status DoExchange(const ServerCallContext& context,
1261 std::unique_ptr<FlightMessageReader> reader,
1262 std::unique_ptr<FlightMessageWriter> writer) override {
1263 FlightStreamChunk chunk;
1264 bool begun = false;
1265 while (true) {
1266 ARROW_ASSIGN_OR_RAISE(chunk, reader->Next());
1267 if (!chunk.data) break;
1268 if (!begun) {
1269 begun = true;
1270 RETURN_NOT_OK(writer->Begin(chunk.data->schema()));
1271 }
1272 RETURN_NOT_OK(CheckBuffersOnDevice(*chunk.data, *device_));
1273 // XXX: do not assume transport will synchronize, we must
1274 // synchronize or else data will be "missing"
1275 RETURN_NOT_OK(context_->Synchronize());
1276 RETURN_NOT_OK(writer->WriteRecordBatch(*chunk.data));
1277 }
1278 return Status::OK();
1279 }
1280
1281 const RecordBatchVector& batches() const { return batches_; }
1282

Callers 1

TestDoExchangeMethod · 0.45

Calls 8

CheckBuffersOnDeviceFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.70
OKFunction · 0.50
NextMethod · 0.45
BeginMethod · 0.45
schemaMethod · 0.45
SynchronizeMethod · 0.45
WriteRecordBatchMethod · 0.45

Tested by

no test coverage detected