Is there a better way to get a Stream<T>
object from a JavaRDD<T>
?
This my current and obvious solution:
JavaRDD<T> rdd = ...;
Stream<T> stream = rdd.collect().stream();
I'm wondering whether is at all possible to avoid creating an intermediary list that will have to hold all the elements in memory at once.