MCPcopy Create free account
hub / github.com/apache/impala / StartWithEphemeralPorts

Method StartWithEphemeralPorts

be/src/testutil/in-process-servers.cc:46–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44using namespace impala;
45
46Status InProcessImpalaServer::StartWithEphemeralPorts(const string& statestore_host,
47 int statestore_port, InProcessImpalaServer** server) {
48 if (FLAGS_rpc_use_unix_domain_socket) {
49 // IMPALA-11129: This test utility function call WaitForServer() to wait KRPC server
50 // to start. WaitForServer(), which is defined in be/src/rpc/thrift-util.c, use
51 // TSocket (Thrift Socket) to connect KRPC server. Even TSocket provide a constructor
52 // with Unix Domain Socket address as parameter, but TSocket don't support UDS
53 // address in the form of name in "Abstract Namespace". So we have to disable KRPC
54 // running over UDS for this unit-test by setting FLAGS_rpc_use_unix_domain_socket
55 // as false.
56 // This function is called by backend unit tests:
57 // be/src/service/session-expiry-test.cc and be/src/exprs/expr-test.cc.
58 FLAGS_rpc_use_unix_domain_socket = false;
59 }
60
61 // This flag is read directly in several places to find the address of the backend
62 // interface, so we must set it here.
63 FLAGS_krpc_port = FindUnusedEphemeralPort();
64
65 *server = new InProcessImpalaServer(
66 FLAGS_hostname, FLAGS_krpc_port, 0, 0, statestore_host, statestore_port);
67 // Start the daemon and check if it works, if not delete the current server object and
68 // pick a new set of ports
69 return (*server)->StartWithClientServers(0, 0, 0);
70}
71
72InProcessImpalaServer::InProcessImpalaServer(const string& hostname, int krpc_port,
73 int subscriber_port, int webserver_port, const string& statestore_host,

Callers

nothing calls this directly

Calls 2

FindUnusedEphemeralPortFunction · 0.85

Tested by

no test coverage detected