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

Function RunMain

cpp/src/arrow/flight/sql/test_server_cli.cc:66–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64#endif
65
66arrow::Status RunMain() {
67#ifdef ARROW_WITH_OPENTELEMETRY
68 ARROW_RETURN_NOT_OK(SetupOTel());
69#endif
70
71 ARROW_ASSIGN_OR_RAISE(auto location,
72 arrow::flight::Location::ForGrpcTcp("0.0.0.0", FLAGS_port));
73 arrow::flight::FlightServerOptions options(location);
74 options.middleware.emplace_back("tracing",
75 arrow::flight::MakeTracingServerMiddlewareFactory());
76
77 std::shared_ptr<arrow::flight::sql::example::SQLiteFlightSqlServer> server;
78 ARROW_ASSIGN_OR_RAISE(server,
79 arrow::flight::sql::example::SQLiteFlightSqlServer::Create())
80
81 ARROW_CHECK_OK(server->Init(options));
82 // Exit with a clean error code (0) on SIGTERM
83 ARROW_CHECK_OK(server->SetShutdownOnSignals({SIGTERM}));
84
85 std::cout << "Server listening on localhost:" << server->port() << std::endl;
86 ARROW_CHECK_OK(server->Serve());
87
88 return arrow::Status::OK();
89}
90
91int main(int argc, char** argv) {
92 gflags::SetUsageMessage("Integration testing server for Flight SQL.");

Callers 1

mainFunction · 0.70

Calls 9

SetupOTelFunction · 0.85
emplace_backMethod · 0.80
SetShutdownOnSignalsMethod · 0.80
ServeMethod · 0.80
ARROW_ASSIGN_OR_RAISEFunction · 0.50
OKFunction · 0.50
InitMethod · 0.45
portMethod · 0.45

Tested by

no test coverage detected