blob: 70fa8f449789746fab23da242f8f35282edb3e68 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
package spark.rdd
import spark.{OneToOneDependency, RDD, Split, TaskContext}
private[spark]
class MappedRDD[U: ClassManifest, T: ClassManifest](
prev: RDD[T],
f: T => U)
extends RDD[U](prev.context) {
override def splits = prev.splits
override val dependencies = List(new OneToOneDependency(prev))
override def compute(split: Split, context: TaskContext) = prev.iterator(split, context).map(f)
}
|