Movatterモバイル変換


[0]ホーム

URL:


spark

RDD

abstractclassRDD[T] extendsSerializable

A Resilient Distributed Dataset (RDD), the basic abstraction in Spark. Represents an immutable,partitioned collection of elements that can be operated on in parallel. This class contains thebasic operations available on all RDDs, such asmap,filter, andpersist. In addition,PairRDDFunctions contains operations available only on RDDs of key-value pairs, suchasgroupByKey andjoin;DoubleRDDFunctions contains operations available only onRDDs of Doubles; andSequenceFileRDDFunctions contains operations available on RDDsthat can be saved as SequenceFiles. These operations are automatically available on any RDD ofthe right type (e.g. RDD[(Int, Int)] through implicit conversions when youimport spark.SparkContext._.

Internally, each RDD is characterized by five main properties:

All of the scheduling and execution in Spark is done based on these methods, allowing each RDDto implement its own way of computing itself. Indeed, users can implement custom RDDs (e.g. forreading data from a new storage system) by overriding these functions. Please refer to theSpark paper for more detailson RDD internals.

Linear Supertypes
Serializable,Serializable, AnyRef,Any
Known Subclasses
CoGroupedRDD,CoalescedRDD,HadoopRDD,NewHadoopRDD,PipedRDD,RepartitionShuffledRDD,SampledRDD,ShuffledAggregatedRDD,ShuffledRDD,ShuffledSortedRDD,UnionRDD
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. RDD
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. newRDD(sc:SparkContext)(implicitarg0: ClassManifest[T])

Abstract Value Members

  1. abstractdefcompute(split:Split): Iterator[T]

    Function for computing a given partition.

  2. abstractvaldependencies: List[spark.Dependency[_]]

    How this RDD depends on any parent RDDs.

  3. abstractdefsplits:Array[Split]

    Set of partitions in this RDD.

Concrete Value Members

  1. finaldef!=(arg0: AnyRef):Boolean

    Definition Classes
    AnyRef
  2. finaldef!=(arg0:Any):Boolean

    Definition Classes
    Any
  3. finaldef##():Int

    Definition Classes
    AnyRef → Any
  4. def++(other:RDD[T]):RDD[T]

    Return the union of this RDD and another one.

    Return the union of this RDD and another one. Any identical elements will appear multipletimes (use.distinct() to eliminate them).

  5. finaldef==(arg0: AnyRef):Boolean

    Definition Classes
    AnyRef
  6. finaldef==(arg0:Any):Boolean

    Definition Classes
    Any
  7. defaggregate[U](zeroValue: U)(seqOp: (U, T) ⇒ U,combOp: (U, U) ⇒ U)(implicitarg0: ClassManifest[U]): U

    Aggregate the elements of each partition, and then the results for all the partitions, usinggiven combine functions and a neutral "zero value".

    Aggregate the elements of each partition, and then the results for all the partitions, usinggiven combine functions and a neutral "zero value". This function can return a different resulttype, U, than the type of this RDD, T. Thus, we need one operation for merging a T into an Uand one operation for merging two U's, as in scala.TraversableOnce. Both of these functions areallowed to modify and return their first argument instead of creating a new U to avoid memoryallocation.

  8. finaldefasInstanceOf[T0]: T0

    Definition Classes
    Any
  9. defcache():RDD[T]

    Persist this RDD with the default storage level (MEMORY_ONLY).

  10. defcartesian[U](other:RDD[U])(implicitarg0: ClassManifest[U]):RDD[(T, U)]

    Return the Cartesian product of this RDD and another one, that is, the RDD of all pairs ofelements (a, b) where a is inthis and b is inother.

  11. defclone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  12. defcollect():Array[T]

    Return an array that contains all of the elements in this RDD.

  13. defcontext:SparkContext

    TheSparkContext that this RDD was created on.

  14. defcount():Long

    Return the number of elements in the RDD.

  15. defcountApprox(timeout:Long,confidence:Double =0.95):PartialResult[BoundedDouble]

    (Experimental) Approximate version of count() that returns a potentially incomplete resultwithin a timeout, even if not all tasks have finished.

  16. defcountByValue():Map[T,Long]

    Return the count of each unique value in this RDD as a map of (value, count) pairs.

    Return the count of each unique value in this RDD as a map of (value, count) pairs. The finalcombine step happens locally on the master, equivalent to running a single reduce task.

  17. defcountByValueApprox(timeout:Long,confidence:Double =0.95):PartialResult[Map[T,BoundedDouble]]

    (Experimental) Approximate version of countByValue().

  18. defdistinct(numSplits:Int =splits.size):RDD[T]

    Return a new RDD containing the distinct elements in this RDD.

  19. finaldefeq(arg0: AnyRef):Boolean

    Definition Classes
    AnyRef
  20. defequals(arg0:Any):Boolean

    Definition Classes
    AnyRef → Any
  21. deffilter(f: (T) ⇒Boolean):RDD[T]

    Return a new RDD containing only the elements that satisfy a predicate.

  22. deffinalize():Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  23. deffirst(): T

    Return the first element in this RDD.

  24. defflatMap[U](f: (T) ⇒ TraversableOnce[U])(implicitarg0: ClassManifest[U]):RDD[U]

    Return a new RDD by first applying a function to all elements of this RDD, and then flattening the results.

  25. deffold(zeroValue: T)(op: (T, T) ⇒ T): T

    Aggregate the elements of each partition, and then the results for all the partitions, using agiven associative function and a neutral "zero value".

    Aggregate the elements of each partition, and then the results for all the partitions, using agiven associative function and a neutral "zero value". The function op(t1, t2) is allowed tomodify t1 and return it as its result value to avoid object allocation; however, it should notmodify t2.

  26. defforeach(f: (T) ⇒Unit):Unit

    Applies a function f to all elements of this RDD.

  27. finaldefgetClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  28. defgetStorageLevel:StorageLevel

    Get the RDD's current storage level, or StorageLevel.

    Get the RDD's current storage level, or StorageLevel.NONE if none is set.

  29. defglom():RDD[Array[T]]

    Return an RDD created by coalescing all elements within each partition into an array.

  30. defgroupBy[K](f: (T) ⇒ K)(implicitarg0: ClassManifest[K]):RDD[(K, Seq[T])]

    Return an RDD of grouped items.

  31. defgroupBy[K](f: (T) ⇒ K,numSplits:Int)(implicitarg0: ClassManifest[K]):RDD[(K, Seq[T])]

    Return an RDD of grouped elements.

    Return an RDD of grouped elements. Each group consists of a key and a sequence of elementsmapping to that key.

  32. defhashCode():Int

    Definition Classes
    AnyRef → Any
  33. valid:Int

    A unique ID for this RDD (within its SparkContext).

  34. finaldefisInstanceOf[T0]:Boolean

    Definition Classes
    Any
  35. finaldefiterator(split:Split): Iterator[T]

    Internal method to this RDD; will read from cache if applicable, or otherwise compute it.

    Internal method to this RDD; will read from cache if applicable, or otherwise compute it.This shouldnot be called by users directly, but is available for implementors of customsubclasses of RDD.

  36. defmap[U](f: (T) ⇒ U)(implicitarg0: ClassManifest[U]):RDD[U]

    Return a new RDD by applying a function to all elements of this RDD.

  37. defmapPartitions[U](f: (Iterator[T]) ⇒ Iterator[U])(implicitarg0: ClassManifest[U]):RDD[U]

    Return a new RDD by applying a function to each partition of this RDD.

  38. defmapPartitionsWithSplit[U](f: (Int, Iterator[T]) ⇒ Iterator[U])(implicitarg0: ClassManifest[U]):RDD[U]

    Return a new RDD by applying a function to each partition of this RDD, while tracking the indexof the original partition.

  39. finaldefne(arg0: AnyRef):Boolean

    Definition Classes
    AnyRef
  40. finaldefnotify():Unit

    Definition Classes
    AnyRef
  41. finaldefnotifyAll():Unit

    Definition Classes
    AnyRef
  42. valpartitioner:Option[Partitioner]

    Optionally overridden by subclasses to specify how they are partitioned.

  43. defpersist():RDD[T]

    Persist this RDD with the default storage level (MEMORY_ONLY).

  44. defpersist(newLevel:StorageLevel):RDD[T]

    Set this RDD's storage level to persist its values across operations after the first timeit is computed.

    Set this RDD's storage level to persist its values across operations after the first timeit is computed. Can only be called once on each RDD.

  45. defpipe(command: Seq[String],env:Map[String, String]):RDD[String]

    Return an RDD created by piping elements to a forked external process.

  46. defpipe(command: Seq[String]):RDD[String]

    Return an RDD created by piping elements to a forked external process.

  47. defpipe(command: String):RDD[String]

    Return an RDD created by piping elements to a forked external process.

  48. defpreferredLocations(split:Split): Seq[String]

    Optionally overridden by subclasses to specify placement preferences.

  49. defreduce(f: (T, T) ⇒ T): T

    Reduces the elements of this RDD using the specified associative binary operator.

  50. defsample(withReplacement:Boolean,fraction:Double,seed:Int):RDD[T]

    Return a sampled subset of this RDD.

  51. defsaveAsObjectFile(path: String):Unit

    Save this RDD as a SequenceFile of serialized objects.

  52. defsaveAsTextFile(path: String):Unit

    Save this RDD as a text file, using string representations of elements.

  53. finaldefsynchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  54. deftake(num:Int):Array[T]

    Take the first num elements of the RDD.

    Take the first num elements of the RDD. This currently scans the partitions *one by one*, soit will be slow if a lot of partitions are required. In that case, use collect() to get thewhole RDD instead.

  55. deftakeSample(withReplacement:Boolean,num:Int,seed:Int):Array[T]

  56. deftoArray():Array[T]

    Return an array that contains all of the elements in this RDD.

  57. deftoString():String

    Definition Classes
    AnyRef → Any
  58. defunion(other:RDD[T]):RDD[T]

    Return the union of this RDD and another one.

    Return the union of this RDD and another one. Any identical elements will appear multipletimes (use.distinct() to eliminate them).

  59. finaldefwait():Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  60. finaldefwait(arg0:Long,arg1:Int):Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  61. finaldefwait(arg0:Long):Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited fromSerializable

Inherited fromSerializable

Inherited from AnyRef

Inherited fromAny


[8]ページ先頭

©2009-2025 Movatter.jp