Filtering JavaRDD in three RDD?
<p>I want to filter a JavaRdd to three different RDDs based on a specific condition.Right now I am reading the same rdd thrice and filtering it.Is there any other efficient way to achieve this in single scan? </p>

<pre><code>Example:

Like I have an rdd of type string and I want to filter it based on name 'anshu','suman' and 'neeraj'

rdd1=rdd.filter(s-&gt;{s.contains("anshu")?return true; else return false;})
rdd2=rdd.filter(s-&gt;{s.contains("suman")?return true; else return false;})
rdd3=rdd.filter(s-&gt;{s.contains("neeraj")?return true; else return false;})

Instead of filtering same rdd thrice,can I do it in single filter?
</code></pre>