title: How do I iterate RDD's in apache spark (scala)
body: <p>I use the following command to fill an RDD with a bunch of arrays containing 2 strings ["filename", "content"].</p>
  
  <p>Now I want to iterate over every of those occurrences  to do something with every filename and content.</p>
  
  <pre><code>val someRDD = sc.wholeTextFiles("hdfs://localhost:8020/user/cloudera/*")
  </code></pre>
  
  <p>I can't seem to find any documentation on how to do this however.</p>
  
  <p>So what I want is this:</p>
  
  <pre><code>foreach occurrence-in-the-rdd{
     //do stuff with the array found on loccation n of the RDD
  } 
  </code></pre>