apache-spark - Spark 是否将中间 shuffle 输出写入磁盘

标签 apache-spark rdd

我在看 Learning Spark ,我不明白 Spark 的 shuffle 输出写入磁盘意味着什么。参见第 8 章,调整和调试 Spark,第 148-149 页:

Spark’s internal scheduler may truncate the lineage of the RDD graph if an existing RDD has already been persisted in cluster memory or on disk. A second case in which this truncation can happen is when an RDD is already materialized as a side effect of an earlier shuffle, even if it was not explicitly persisted. This is an under-the-hood optimization that takes advantage of the fact that Spark shuffle outputs are written to disk, and exploits the fact that many times portions of the RDD graph are recomputed.



据我了解有不同的持久性策略,例如,默认 MEMORY_ONLY这意味着中间结果永远不会持久化到磁盘。

shuffle 何时以及为什么会在磁盘上保留某些内容?如何通过进一步的计算重用它?

最佳答案

什么时候

第一次评估需要 shuffle 的操作( Action )并且无法禁用时会发生这种情况

为什么

这是一个优化。改组是 Spark 中发生的昂贵的事情之一。

如何通过进一步的计算重用它?

它会自动与在同一 RDD 上执行的任何后续操作重用。

关于apache-spark - Spark 是否将中间 shuffle 输出写入磁盘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40949835/

相关文章:

python - 正确使用大广播变量的技巧?

apache-spark - Spark 2.0 中的全阶段代码生成

scala - 无法使用 IntelliJ 在本地连接到 hdfs kerberized 集群

scala - 何时使用 countByValue 何时使用 map().reduceByKey()

scala - 为什么 Writable 的隐式转换不起作用

java - Spark 转换和 Action 的逻辑是否需要线程安全?

java - Spark模式rdd到RDD

hadoop - Hive(在Tez上)和Spark之间针对我的特定用例进行的性能基准测试

java - 合并两个 JavaPairRDD

dataframe - Spark Scala Cassandra 连接器删除所有所有行失败,IllegalArgumentException 要求失败异常