| 183 | std::unique_ptr<arrow::flight::FlightServerBase> g_server; |
| 184 | |
| 185 | int main(int argc, char** argv) { |
| 186 | gflags::SetUsageMessage("Integration testing server for Flight."); |
| 187 | gflags::ParseCommandLineFlags(&argc, &argv, true); |
| 188 | |
| 189 | std::shared_ptr<arrow::flight::integration_tests::Scenario> scenario; |
| 190 | |
| 191 | if (!FLAGS_scenario.empty()) { |
| 192 | ARROW_CHECK_OK( |
| 193 | arrow::flight::integration_tests::GetScenario(FLAGS_scenario, &scenario)); |
| 194 | } else { |
| 195 | scenario = |
| 196 | std::make_shared<arrow::flight::integration_tests::IntegrationTestScenario>(); |
| 197 | } |
| 198 | arrow::flight::Location location; |
| 199 | ARROW_CHECK_OK( |
| 200 | arrow::flight::Location::ForGrpcTcp("0.0.0.0", FLAGS_port).Value(&location)); |
| 201 | arrow::flight::FlightServerOptions options(location); |
| 202 | |
| 203 | ARROW_CHECK_OK(scenario->MakeServer(&g_server, &options)); |
| 204 | |
| 205 | ARROW_CHECK_OK(g_server->Init(options)); |
| 206 | // Exit with a clean error code (0) on SIGTERM |
| 207 | ARROW_CHECK_OK(g_server->SetShutdownOnSignals({SIGTERM})); |
| 208 | |
| 209 | std::cout << "Server listening on localhost:" << g_server->port() << std::endl; |
| 210 | ARROW_CHECK_OK(g_server->Serve()); |
| 211 | return 0; |
| 212 | } |
nothing calls this directly
no test coverage detected