RDD(Resilient Distributed Dataset)
 
abstract class RDD[T: ClassTag](
    @transient private var _sc: SparkContext,
    @transient private var deps: Seq[Dependency[_]]
  ) extends Serializable with Logging
 
 
1.RDD是一个抽象类(不能直接使用,子类实现抽象方法后才能用)
2.带泛型的,可以支持多种类型:String、Person、User
RDD:Resilient Distributed Dataset 弹性 分布式 数据集
 
Represents an immutable,(不可变)
 partitioned collection of elements (分区)
that can be operated on in parallel   (并行计算)
 
 Internally, each RDD is characterized by five main properties:
 *
 *  - A list of partitions
 *  - A function for computing each split
 *  - A list of dependencies on other RDDs
    rdd1=>rdd2=>rdd3
 *  - Optionally, a Partitioner for key-value RDDs (e.g. to say that the RDD is hash-partitioned)
 *  - Optionally, a list of preferred locations to compute each split on (e.g. block locations for
 *    an HDFS file)   数据在哪优先把作业调度到数据所在结点计算:移动数据不如移动计算
 
五大特性源码体现
 
 def compute(split: Partition, context: TaskContext): Iterator[T]    特性二
 
protected def getPartitions: Array[Partition] 特性一
 
protected def getDependencies: Seq[Dependency[_]] = deps  特性三
 
protected def getPreferredLocations(split: Partition): Seq[String] = Nil   特性五
 
val partitioner: Option[Partitioner] = None    特性四
 
 
 
 
    
 

最新文章

  1. GDB调试命令
  2. JavaScript执行环境
  3. [LeetCode] Max Sum of Rectangle No Larger Than K 最大矩阵和不超过K
  4. json_encode 中文乱码
  5. SQLServer2005删除log文件和清空日志的方案
  6. 需要一个策略文件,但在加载此媒体时未设置checkPolicyFile标志
  7. 22 java当中的数组
  8. windows下安装coreseek/sphinx
  9. HDU-----(4858)项目管理(模拟)
  10. javascript小数四舍五入
  11. Hunt the Wumpus第二个版本---多怪兽,多洞穴,洞穴间双向互通
  12. (转+原)VC编译错误:uafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) 已经在 LIBCMT.lib(new.obj) 中定义
  13. jquery multiselect控件
  14. c++自带倒置数组函数
  15. Luogu 3390 【模板】矩阵快速幂 (矩阵乘法,快速幂)
  16. webpack之深入浅出externals
  17. jQuery 核心函数 (十一)
  18. node.js代理设置
  19. jenkins系列之添加全局配置(一)
  20. left join 太神奇了

热门文章

  1. 简述MapReduce数据流
  2. maven-dependencyManagement和dependencies区别
  3. 文本数据和mysql 里面的数据比较
  4. python自动生成useragent
  5. codeforces round#524 C. Masha and two friends /// 矩形切割
  6. NuGet包介绍
  7. 2018自己的JavaScript开发指南
  8. kaggle 实战 (1): PCA + KNN 手写数字识别
  9. bootstrap 幻灯片(轮播)
  10. p分位数的原理及计算