Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

我在 spark-shell 下面运行一个最简单的 wordcount 程序,

val text = spark.read.textFile("/datasets/wordcount_512m.txt")
text.flatMap(line => line.split(" ")).groupByKey(identity).count().collect()

我的 hdfs 块大小为 128 MB,配置是 2 个 executor,每个 executor 2个核,也就是说这个任务会有4个partition。然后我看 Spark 的UI面板,在 stage 0 阶段是正常的,有4个task同时执行。
image.png
但是在 stage 1 阶段,我发现有些 task id 更大的任务会先执行,这是为什么。
image.png
image.png
就比如上面两张图,task id 为91的执行先于task id 为0执行,这是为什么。

这些提早执行的 task id 又是干什么的?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.2k views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...