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

Function get_external_ip

tests/common/network.py:27–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25# Retrieves the host external IP rather than localhost/127.0.0.1 so we have an IP that
26# Impala will consider distinct from storage backends to force remote scheduling.
27def get_external_ip():
28 with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as s:
29 s.settimeout(0)
30 # This address is used to get the networking stack to identify a return IP address.
31 # Timeout=0 means it doesn't need to resolve.
32 s.connect(('10.254.254.254', 1))
33 return s.getsockname()[0]
34
35
36def split_host_port(host_port):

Callers

nothing calls this directly

Calls 2

socketMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected