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

Method DoGet

cpp/src/arrow/flight/transport_server.cc:298–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296} // namespace
297
298Status ServerTransport::DoGet(const ServerCallContext& context, const Ticket& ticket,
299 ServerDataStream* stream) {
300 std::unique_ptr<FlightDataStream> data_stream;
301 RETURN_NOT_OK(base_->DoGet(context, ticket, &data_stream));
302
303 if (!data_stream) return Status::KeyError("No data in this flight");
304
305 // Write the schema as the first message in the stream
306 ARROW_ASSIGN_OR_RAISE(auto schema_payload, data_stream->GetSchemaPayload());
307 ARROW_ASSIGN_OR_RAISE(auto success, stream->WriteData(schema_payload));
308 // Connection terminated
309 if (!success) return Status::OK();
310
311 // Consume data stream and write out payloads
312 while (true) {
313 ARROW_ASSIGN_OR_RAISE(FlightPayload payload, data_stream->Next());
314 // End of stream
315 if (payload.ipc_message.metadata == nullptr) break;
316 ARROW_ASSIGN_OR_RAISE(auto success, stream->WriteData(payload));
317 // Connection terminated
318 if (!success) return Status::OK();
319 }
320 RETURN_NOT_OK(stream->WritesDone());
321 return data_stream->Close();
322}
323
324Status ServerTransport::DoPut(const ServerCallContext& context,
325 ServerDataStream* stream) {

Callers

nothing calls this directly

Calls 4

KeyErrorFunction · 0.85
OKFunction · 0.50
WritesDoneMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected