title: How does Apache Spark know about HDFS data nodes?
body: <p>Imagine I do some Spark operations on a file hosted in HDFS. Something like this:</p>
  
  <pre><code>var file = sc.textFile("hdfs://...")
  val items = file.map(_.split('\t'))
  ...
  </code></pre>
  
  <p>Because in the Hadoop world the code should go where the data is, right? </p>
  
  <p>So my question is: How do <strong>Spark workers</strong> know of <strong>HDFS data nodes</strong>? How does Spark know on which Data Nodes to execute the code?</p>