title: Spark uses only one core when using forEachRemaining
body: <p>I'm still new to Spark. I wrote this code to parse large string list.</p>
  
  <p>I had to use <code>forEachRemaining</code> because I had to initialize some non-serializable objects in each partition. </p>
  
  <pre><code>    JavaRDD&lt;String&gt; lines=initRetriever();
      lines.foreachPartition(iter-&gt;{
          Obj1 obj1=initObj1()
          MyStringParser parser=new MyStringParser(obj1);
          iter.forEachRemaining(str-&gt;{
              try {
                  parser.parse(str);
              } catch (ParsingException e) {
                  e.printStackTrace();
              }
          });
  
          System.out.print("all parsed");
          obj1.close();
      });
  </code></pre>
  
  <p>I believe Spark is all about parallelism. But this program uses only a single thread on my local machine. Did I do something wrong? Missing configuration? Or maybe the <code>iter</code> doesn't allow it to execute all in parallel.</p>
  
  <h3>EDIT</h3>
  
  <p>I have no configuration files for Spark. </p>
  
  <p>That's how I initialize Spark</p>
  
  <pre><code>SparkConf conf = new SparkConf()
                  .setAppName(AbstractSparkImporter.class.getCanonicalName())
                  .setMaster("local");
  </code></pre>
  
  <p>I run it on IDE and using <code>mvn:exec</code> command.</p>