【发布时间】:2017-01-17 02:55:33
【问题描述】:
谁能解释为什么 rdd 块在我第二次运行 spark 代码时会增加,即使它们在第一次运行期间存储在 spark 内存中。我正在使用线程提供输入。rdd 块的确切含义是什么。
【问题讨论】:
标签: apache-spark rdd
谁能解释为什么 rdd 块在我第二次运行 spark 代码时会增加,即使它们在第一次运行期间存储在 spark 内存中。我正在使用线程提供输入。rdd 块的确切含义是什么。
【问题讨论】:
标签: apache-spark rdd
我今天一直在研究这个,似乎 RDD 块是 RDD 块和非 RDD 块的总和。 查看代码: https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/ui/exec/ExecutorsPage.scala
val rddBlocks = status.numBlocks
如果您转到 Github 上 Apache Spark Repo 的以下链接: https://github.com/apache/spark/blob/d5b1d5fc80153571c308130833d0c0774de62c92/core/src/main/scala/org/apache/spark/storage/StorageUtils.scala
你会发现下面的代码行:
/**
* Return the number of blocks stored in this block manager in O(RDDs) time.
*
* @note This is much faster than `this.blocks.size`, which is O(blocks) time.
*/
def numBlocks: Int = _nonRddBlocks.size + numRddBlocks
非 rdd 块是由广播变量创建的块,因为它们作为缓存块存储在内存中。驱动程序通过广播变量将任务发送给执行程序。 现在这些系统创建的广播变量通过 ContextCleaner 服务被删除,因此相应的非 RDD 块被删除。 RDD 块通过 rdd.unpersist() 取消持久化。
【讨论】: