| 64 | #endif |
| 65 | |
| 66 | arrow::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 | |
| 91 | int main(int argc, char** argv) { |
| 92 | gflags::SetUsageMessage("Integration testing server for Flight SQL."); |
no test coverage detected