title: How to process each line of file parrallely in Spark using java?
body: <p>I have a file which contains multiple urls.
  I want to read each of this url and do some processing on it.
  As processing part is independent for each url I would like to do this in parallel on Spark.</p>
  
  <pre><code>SparkConf conf = new SparkConf().setAppName("org.sparkexample.WordCount").setMaster("local");
  JavaSparkContext context = new JavaSparkContext(conf);
  JavaRDD&lt;String&gt; textFile = context.textFile("urlFile");
  /* Now for each line of this textFile I need to call below */
  
  ExtractTrainingData ed = new ExtractTrainingData();
  List&lt;Elements&gt; list = ed.getElementList(inputUrl);
  ed.processElementList( inputUrl, list); 
  </code></pre>
  
  <p>Can any one suggest how can I do this?</p>