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

Method Init

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

Source from the content-addressed store, hash-verified

84 memory_manager_(std::move(memory_manager)) {}
85
86 Status Init() {
87 // Peek the first message to get the descriptor.
88 internal::FlightData* data;
89 peekable_reader_->Peek(&data);
90 if (!data) {
91 return Status::IOError("Stream finished before first message sent");
92 }
93 if (!data->descriptor) {
94 return Status::IOError("Descriptor missing on first message");
95 }
96 descriptor_ = *data->descriptor;
97 // If there's a schema (=DoPut), also Open().
98 if (data->metadata) {
99 return EnsureDataStarted();
100 }
101 peekable_reader_->Next(&data);
102 return Status::OK();
103 }
104
105 const FlightDescriptor& descriptor() const override { return descriptor_; }
106

Callers 2

DoPutMethod · 0.45
DoExchangeMethod · 0.45

Calls 4

IOErrorFunction · 0.85
OKFunction · 0.50
PeekMethod · 0.45
NextMethod · 0.45

Tested by

no test coverage detected