Convert iterable to RDD
<p>I want to save from spark-streaming to couple of elastic-search indices. 
I create pairs of <code>&lt;key(index), value&gt;</code>, when I execute groupByKey the result is Tuple of <code>&lt;key(index), Iterable&lt;value&gt;&gt;</code> but in order to save to elasticsearch using elasticsearch-spark plugin I need the values as <code>JavaRDD&lt;value&gt;</code>.</p>

<p>I know that there is an option of sparkContext.parallelize(list) which creates JavaRDD from list, but this can be executed only on the driver.</p>

<p>Is there another option to create JavaRDD that can be executed on the executor? Or another way that I can achieve <code>Tuple2&lt;key(index), JavaRDD&lt;value&gt;&gt;</code> which works on executor?
If not how can I make only the switch of Iterator to JavaRDD on driver and the plugin writing to elasticsearch at the executor?</p>

<p>Thanks,</p>

<p>Daniela</p>