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

Function main

cpp/src/arrow/flight/test_server.cc:39–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37std::unique_ptr<arrow::flight::FlightServerBase> g_server;
38
39int 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}

Callers

nothing calls this directly

Calls 5

SetShutdownOnSignalsMethod · 0.80
ServeMethod · 0.80
MakeFunction · 0.50
emptyMethod · 0.45
InitMethod · 0.45

Tested by

no test coverage detected