diff options
author | Shivaram Venkataraman <shivaram@eecs.berkeley.edu> | 2013-12-19 11:49:17 -0800 |
---|---|---|
committer | Shivaram Venkataraman <shivaram@eecs.berkeley.edu> | 2013-12-19 11:49:17 -0800 |
commit | 9cc3a6d3c0a64b80af77ae358c58d4b29b18c534 (patch) | |
tree | e8e17e8efaef9d161023a900e20f1689a11bbdb5 /core | |
parent | d3234f9726db3917af4688ba70933938b078b0bd (diff) | |
download | spark-9cc3a6d3c0a64b80af77ae358c58d4b29b18c534.tar.gz spark-9cc3a6d3c0a64b80af77ae358c58d4b29b18c534.tar.bz2 spark-9cc3a6d3c0a64b80af77ae358c58d4b29b18c534.zip |
Add comment explaining collectPartitions's use
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala b/core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala index 458d9dcbc3..f344804b4c 100644 --- a/core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala +++ b/core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala @@ -248,6 +248,8 @@ trait JavaRDDLike[T, This <: JavaRDDLike[T, This]] extends Serializable { * Return an array that contains all of the elements in a specific partition of this RDD. */ def collectPartitions(partitionIds: Array[Int]): Array[JList[T]] = { + // This is useful for implementing `take` from other language frontends + // like Python where the data is serialized. import scala.collection.JavaConversions._ val res = context.runJob(rdd, (it: Iterator[T]) => it.toArray, partitionIds, true) res.map(x => new java.util.ArrayList(x.toSeq)).toArray |