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

Method GetFlightInfo

cpp/src/arrow/flight/perf_server.cc:168–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166 void SetLocation(Location location) { location_ = location; }
167
168 Status GetFlightInfo(const ServerCallContext& context, const FlightDescriptor& request,
169 std::unique_ptr<FlightInfo>* info) override {
170 perf::Perf perf_request;
171 CHECK_PARSE(perf_request.ParseFromString(request.cmd));
172
173 perf::Token token;
174 token.mutable_definition()->CopyFrom(perf_request);
175
176 std::vector<FlightEndpoint> endpoints;
177 Ticket tmp_ticket;
178 for (int64_t i = 0; i < perf_request.stream_count(); ++i) {
179 token.set_start(i * perf_request.records_per_stream());
180 token.set_end((i + 1) * perf_request.records_per_stream());
181
182 (void)token.SerializeToString(&tmp_ticket.ticket);
183
184 // All endpoints same location for now
185 endpoints.push_back(FlightEndpoint{tmp_ticket, {location_}, std::nullopt, ""});
186 }
187
188 uint64_t total_records =
189 perf_request.stream_count() * perf_request.records_per_stream();
190
191 *info = std::make_unique<FlightInfo>(
192 MakeFlightInfo(*perf_schema_, request, endpoints, total_records, -1, false, ""));
193 return Status::OK();
194 }
195
196 Status DoGet(const ServerCallContext& context, const Ticket& request,
197 std::unique_ptr<FlightDataStream>* data_stream) override {

Callers

nothing calls this directly

Calls 5

MakeFlightInfoFunction · 0.85
push_backMethod · 0.80
OKFunction · 0.50
CopyFromMethod · 0.45
SerializeToStringMethod · 0.45

Tested by

no test coverage detected