aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/scala/spark/rdd/EmptyRDD.scala
blob: e4dd3a7fa7dce14b1641539412098d13bb0f8ea7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package spark.rdd

import spark.{RDD, SparkContext, SparkEnv, Partition, TaskContext}


/**
 * An RDD that is empty, i.e. has no element in it.
 */
class EmptyRDD[T: ClassManifest](sc: SparkContext) extends RDD[T](sc, Nil) {

  override def getPartitions: Array[Partition] = Array.empty

  override def compute(split: Partition, context: TaskContext): Iterator[T] = {
    throw new UnsupportedOperationException("empty RDD")
  }
}