diff options
author | Matei Zaharia <matei@eecs.berkeley.edu> | 2012-11-19 13:23:39 -0800 |
---|---|---|
committer | Matei Zaharia <matei@eecs.berkeley.edu> | 2012-11-19 13:23:39 -0800 |
commit | 3ff6f4bdee717d89589d0a522225d746b5518650 (patch) | |
tree | 53ad609cb7b34e3a6ed961fe2b4f6b51c801bd31 | |
parent | 20a1058dd53222d1453087e28c1a90a723974c72 (diff) | |
parent | 00f4e3ff9c5d7cf36c00ea66c9610d457670d2a0 (diff) | |
download | spark-3ff6f4bdee717d89589d0a522225d746b5518650.tar.gz spark-3ff6f4bdee717d89589d0a522225d746b5518650.tar.bz2 spark-3ff6f4bdee717d89589d0a522225d746b5518650.zip |
Merge pull request #304 from mbautin/configurable_local_ip
SPARK-624: make the default local IP customizable
-rw-r--r-- | core/src/main/scala/spark/Utils.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/src/main/scala/spark/Utils.scala b/core/src/main/scala/spark/Utils.scala index 567c4b1475..c8799e6de3 100644 --- a/core/src/main/scala/spark/Utils.scala +++ b/core/src/main/scala/spark/Utils.scala @@ -199,7 +199,13 @@ private object Utils extends Logging { /** * Get the local host's IP address in dotted-quad format (e.g. 1.2.3.4). */ - def localIpAddress(): String = InetAddress.getLocalHost.getHostAddress + def localIpAddress(): String = { + val defaultIpOverride = System.getenv("SPARK_LOCAL_IP") + if (defaultIpOverride != null) + defaultIpOverride + else + InetAddress.getLocalHost.getHostAddress + } private var customHostname: Option[String] = None |