spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [3/6] git commit: Add comment explaining collectPartitions's use
Date Thu, 23 Jan 2014 08:19:04 GMT
Add comment explaining collectPartitions's use


Project: http://git-wip-us.apache.org/repos/asf/incubator-spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-spark/commit/3ef68e49
Tree: http://git-wip-us.apache.org/repos/asf/incubator-spark/tree/3ef68e49
Diff: http://git-wip-us.apache.org/repos/asf/incubator-spark/diff/3ef68e49

Branch: refs/heads/branch-0.8
Commit: 3ef68e49ef7c5548e2978beb7b2f903f00b50d95
Parents: 91e6e5b
Author: Shivaram Venkataraman <shivaram@eecs.berkeley.edu>
Authored: Thu Dec 19 11:49:17 2013 -0800
Committer: Shivaram Venkataraman <shivaram@eecs.berkeley.edu>
Committed: Thu Jan 16 19:21:18 2014 -0800

----------------------------------------------------------------------
 core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/3ef68e49/core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala
----------------------------------------------------------------------
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 f3dd013..2283a8e 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
@@ -250,6 +250,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


Mime
View raw message