diff options
author | Matei Zaharia <matei@eecs.berkeley.edu> | 2013-02-19 17:07:00 -0800 |
---|---|---|
committer | Matei Zaharia <matei@eecs.berkeley.edu> | 2013-02-19 17:07:00 -0800 |
commit | a3e86b2b1fb20cab8fde2cf2012ad69905816b0d (patch) | |
tree | e55368dca5754f5979682e2256db7d8b7345be78 /core | |
parent | 03d847999e8c54684128573b94973544026081b2 (diff) | |
parent | 130f704bafe9e327e8974f6ed3a4e00c478f6279 (diff) | |
download | spark-a3e86b2b1fb20cab8fde2cf2012ad69905816b0d.tar.gz spark-a3e86b2b1fb20cab8fde2cf2012ad69905816b0d.tar.bz2 spark-a3e86b2b1fb20cab8fde2cf2012ad69905816b0d.zip |
Merge pull request #483 from rxin/splitpruningrdd2
Added a method to create PartitionPruningRDD.
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/scala/spark/rdd/PartitionPruningRDD.scala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/src/main/scala/spark/rdd/PartitionPruningRDD.scala b/core/src/main/scala/spark/rdd/PartitionPruningRDD.scala index f2f4fd56d1..41ff62dd22 100644 --- a/core/src/main/scala/spark/rdd/PartitionPruningRDD.scala +++ b/core/src/main/scala/spark/rdd/PartitionPruningRDD.scala @@ -40,3 +40,15 @@ class PartitionPruningRDD[T: ClassManifest]( override protected def getPartitions: Array[Partition] = getDependencies.head.asInstanceOf[PruneDependency[T]].partitions } + + +object PartitionPruningRDD { + + /** + * Create a PartitionPruningRDD. This function can be used to create the PartitionPruningRDD + * when its type T is not known at compile time. + */ + def create[T](rdd: RDD[T], partitionFilterFunc: Int => Boolean) = { + new PartitionPruningRDD[T](rdd, partitionFilterFunc)(rdd.elementClassManifest) + } +} |