| 37 | std::unique_ptr<arrow::flight::FlightServerBase> g_server; |
| 38 | |
| 39 | int main(int argc, char** argv) { |
| 40 | gflags::ParseCommandLineFlags(&argc, &argv, true); |
| 41 | |
| 42 | g_server = arrow::flight::TestFlightServer::Make(); |
| 43 | |
| 44 | arrow::flight::Location location; |
| 45 | if (FLAGS_unix.empty()) { |
| 46 | location = *arrow::flight::Location::ForGrpcTcp("0.0.0.0", FLAGS_port); |
| 47 | } else { |
| 48 | location = *arrow::flight::Location::ForGrpcUnix(FLAGS_unix); |
| 49 | } |
| 50 | arrow::flight::FlightServerOptions options(location); |
| 51 | |
| 52 | ARROW_CHECK_OK(g_server->Init(options)); |
| 53 | // Exit with a clean error code (0) on SIGTERM |
| 54 | ARROW_CHECK_OK(g_server->SetShutdownOnSignals({SIGTERM})); |
| 55 | |
| 56 | if (FLAGS_unix.empty()) { |
| 57 | std::cout << "Server listening on localhost:" << FLAGS_port << std::endl; |
| 58 | } else { |
| 59 | std::cout << "Server listening on unix://" << FLAGS_unix << std::endl; |
| 60 | } |
| 61 | ARROW_CHECK_OK(g_server->Serve()); |
| 62 | return 0; |
| 63 | } |
nothing calls this directly
no test coverage detected