Skip to content

Instantly share code, notes, and snippets.

View ftom's full-sized avatar

F-Tom ftom

  • Komodo Health
  • Paris
View GitHub Profile
@ftom
ftom / Spark::findLocalIpAddress
Created November 1, 2014 12:43
How Spark determines the default IP to use for the Spark driver
/**
* Get the local host's IP address in dotted-quad format (e.g. 1.2.3.4).
* Note, this is typically not used from within core spark.
*/
lazy val localIpAddress: String = findLocalIpAddress()
lazy val localIpAddressHostname: String = getAddressHostName(localIpAddress)
private def findLocalIpAddress(): String = {
val defaultIpOverride = System.getenv("SPARK_LOCAL_IP")
if (defaultIpOverride != null) {

Keybase proof

I hereby claim:

  • I am ftom on github.
  • I am ftom (https://keybase.io/ftom) on keybase.
  • I have a public key whose fingerprint is F49F 545B D21A F843 0A55 C185 E3C4 BEAD A9B7 31F5

To claim this, I am signing this object: