RDD 五大特性

1)A list of partitions

一组分区:RDD由很多partition构成,有多少partition就对应有多少task

2)A function for computing each split

一个函数:对RDD做计算,相当于对RDD的每个split或partition做计算

3)A list of dependencies on other RDDs

RDD之间有依赖关系,可溯源

4)Optionally, a Partitioner for key-value RDDs (e.g. to say that the RDD is hash-partitioned)

一个Partitioner:即RDD的分片函数,如果RDD里面存的数据是key-value形式,则可以传递一个自定义的Partitioner进行重新分区

5)Optionally, a list of preferred locations to compute each split on (e.g. block locations for an HDFS file)

一个列表:存储存取每个Partition的优先位置(preferred location),计算每个split时,在split所在机器的本地上运行task是最好的,避免了数据的移动,split有多个副本,所以preferred location不止一个

posted @ 2019-07-21 16:01  北漂屌丝  阅读(1639)  评论(0编辑  收藏  举报