IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    [原]Stage 细解

    book_mmicky发表于 2014-05-13 15:24:08
    love 0
    Spark Application在遇到action算子时,SparkContext会生成Job,并将构成DAG图将给DAG Scheduler解析成Stage。
    Stage有两种:
    • ShuffleMapStage 
      • 这种Stage是以Shuffle为输出边界
      • 其输入边界可以是从外部获取数据,也可以是另一个ShuffleMapStage的输出
      • 其输出可以是另一个Stage的开始
      • ShuffleMapStage的最后Task就是ShuffleMapTask
      • 在一个Job里可能有该类型的Stage,也可以能没有该类型Stage。
    • ResultStage 
      • 这种Stage是直接输出结果
      • 其输入边界可以是从外部获取数据,也可以是另一个ShuffleMapStage的输出
      • ResultStage的最后Task就是ResultTask
      • 在一个Job里必定有该类型Stage。
    一个Job含有一个或多个Stage,但至少含有一个ResultStage。

    相关信息可以参看源码:org.apache.spark.scheduler 中Stage.class

    /** * Each Stage can either be a shuffle map stage, in which case its tasks' results are input for * another stage, or a result stage, in which case its tasks directly compute the action that * initiated a job (e.g. count(), save(), etc). For shuffle map stages, we also track the nodes * that each output partition is on. */





沪ICP备19023445号-2号
友情链接