| 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. |
| 27 | def 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 | |
| 36 | def split_host_port(host_port): |