@Author Jeffrey.miao
转载请标明出处: Spark-shuffle源码细读一:ShuffleManager_The_Inertia的博客-CSDN博客欢迎关注个人知乎专栏:Spark源码学习成长 - 知乎
version:spark 3.0.1
ShuffleManager目前只有一个实现SortShuffleManager。分析其源码:
一.成员变量
1.taskIdMapsForShuffle
/**
* A mapping from shuffle ids to the task ids of mappers producing output for those shuffles.
*/
private[this] val taskIdMapsForShuffle = new ConcurrentHashMap[Int, OpenHashSet[Long]]()
taskIdMapsForShuffle,记录了ShuffleId和其对应的taskIds的映射关系。
<一个ShuffleDependency对应一个shuffleId(从0开始累加)