{"id":142523,"date":"2020-08-03T23:57:48","date_gmt":"2020-08-03T15:57:48","guid":{"rendered":"http:\/\/4563.org\/?p=142523"},"modified":"2020-08-03T23:57:48","modified_gmt":"2020-08-03T15:57:48","slug":"spark-rdd%e7%9a%84%e4%be%9d%e8%b5%96%e5%85%b3%e7%b3%bb%e4%bb%a5%e5%8f%8adag%e5%88%92%e5%88%86stage","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=142523","title":{"rendered":"Spark RDD\u7684\u4f9d\u8d56\u5173\u7cfb\u4ee5\u53caDAG\u5212\u5206stage"},"content":{"rendered":"<h2><a href=\"https:\/\/www.studytime.xin\/article\/#RDD-\u7684\u5bbd\u4f9d\u8d56\u548c\u7a84\u4f9d\u8d56\" title=\"RDD \u7684\u5bbd\u4f9d\u8d56\u548c\u7a84\u4f9d\u8d56\"><\/a>RDD \u7684\u5bbd\u4f9d\u8d56\u548c\u7a84\u4f9d\u8d56<\/h2>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/08\/20200803_5f28421542d12.png\" alt=\"Spark RDD\u7684\u4f9d\u8d56\u5173\u7cfb\u4ee5\u53caDAG\u5212\u5206stage\"><\/p>\n<p>\u7531\u4e8e RDD \u662f\u7c97\u7c92\u5ea6\u7684\u64cd\u4f5c\u6570\u636e\u96c6\uff0c\u6bcf\u4e2a Transformation \u64cd\u4f5c\u90fd\u4f1a\u751f\u6210\u4e00\u4e2a\u65b0\u7684 RDD\uff0c\u6240\u4ee5 RDD \u4e4b\u95f4\u5c31\u4f1a\u5f62\u6210\u7c7b\u4f3c\u6d41\u6c34\u7ebf\u7684\u524d\u540e\u4f9d\u8d56\u5173\u7cfb\uff1bRDD \u548c\u5b83\u4f9d\u8d56\u7684\u7236 RDD\uff08s\uff09\u7684\u5173\u7cfb\u6709\u4e24\u79cd\u4e0d\u540c\u7684\u7c7b\u578b\uff0c\u5373\u7a84\u4f9d\u8d56\uff08Narrow Dependency\uff09\u548c\u5bbd\u4f9d\u8d56\uff08Wide Dependency\uff09\u3002<\/p>\n<h3><a href=\"https:\/\/www.studytime.xin\/article\/#\u7a84\u4f9d\u8d56\" title=\"\u7a84\u4f9d\u8d56\"><\/a>\u7a84\u4f9d\u8d56<\/h3>\n<p>\u6307\u7684\u662f\u5b50 RDD \u53ea\u4f9d\u8d56\u4e8e\u7236 RDD \u4e2d\u4e00\u4e2a\u56fa\u5b9a\u6570\u91cf\u7684\u5206\u533a\u3002<\/p>\n<h3><a href=\"https:\/\/www.studytime.xin\/article\/#\u5bbd\u4f9d\u8d56\" title=\"\u5bbd\u4f9d\u8d56\"><\/a>\u5bbd\u4f9d\u8d56<\/h3>\n<p>\u6307\u7684\u662f\u5b50 RDD \u7684\u6bcf\u4e00\u4e2a\u5206\u533a\u90fd\u4f9d\u8d56\u4e8e\u7236 RDD \u7684\u6240\u6709\u5206\u533a\u3002<\/p>\n<p>\u7531\u4e0a\u56fe\u53ef\u77e5\uff0cjoin\u5206\u4e3a\u5bbd\u4f9d\u8d56\u548c\u7a84\u4f9d\u8d56\uff0c\u5982\u679cRDD\u6709\u76f8\u540c\u7684partitioner\uff0c\u90a3\u4e48\u5c06\u4e0d\u4f1a\u5f15\u8d77shuffle\uff0c\u8fd9\u79cdjoin\u662f\u7a84\u4f9d\u8d56\uff0c\u53cd\u4e4b\u5c31\u662f\u5bbd\u4f9d\u8d56<\/p>\n<h2><a href=\"https:\/\/www.studytime.xin\/article\/#DAG\u5212\u5206stage\" title=\"DAG\u5212\u5206stage\"><\/a>DAG\u5212\u5206stage<\/h2>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/08\/20200803_5f28421d6445e.png\" alt=\"Spark RDD\u7684\u4f9d\u8d56\u5173\u7cfb\u4ee5\u53caDAG\u5212\u5206stage\"><\/p>\n<h3><a href=\"https:\/\/www.studytime.xin\/article\/#stage\u662f\u4ec0\u4e48\" title=\"stage\u662f\u4ec0\u4e48\"><\/a>stage\u662f\u4ec0\u4e48<\/h3>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/08\/20200803_5f284222a8e0b.png\" alt=\"Spark RDD\u7684\u4f9d\u8d56\u5173\u7cfb\u4ee5\u53caDAG\u5212\u5206stage\"><\/p>\n<p>\u5728 Spark \u4e2d\uff0cSpark \u4f1a\u5c06\u6bcf\u4e00\u4e2a Job \u5206\u4e3a\u591a\u4e2a\u4e0d\u540c\u7684 Stage, \u800c Stage \u4e4b\u95f4\u7684\u4f9d\u8d56\u5173\u7cfb\u5219\u5f62\u6210\u4e86\u6709\u5411\u65e0\u73af\u56fe\uff0cSpark \u4f1a\u6839\u636e RDD \u4e4b\u95f4\u7684\u4f9d\u8d56\u5173\u7cfb\u5c06 DAG \u56fe\uff08\u6709\u5411\u65e0\u73af\u56fe\uff09\u5212\u5206\u4e3a\u4e0d\u540c\u7684\u9636\u6bb5\uff0c\u5bf9\u4e8e\u7a84\u4f9d\u8d56\uff0c\u7531\u4e8e Partition \u4f9d\u8d56\u5173\u7cfb\u7684\u786e\u5b9a\u6027\uff0cPartition \u7684\u8f6c\u6362\u5904\u7406\u5c31\u53ef\u4ee5\u5728\u540c\u4e00\u4e2a\u7ebf\u7a0b\u91cc\u5b8c\u6210\uff0c\u7a84\u4f9d\u8d56\u5c31\u88ab Spark \u5212\u5206\u5230\u540c\u4e00\u4e2a stage \u4e2d\uff0c\u800c\u5bf9\u4e8e\u5bbd\u4f9d\u8d56\uff0c\u53ea\u80fd\u7b49\u7236RDD shuffle \u5904\u7406\u5b8c\u6210\u540e\uff0c\u4e0b\u4e00\u4e2a stage \u624d\u80fd\u5f00\u59cb\u63a5\u4e0b\u6765\u7684\u8ba1\u7b97\u3002<\/p>\n<h3><a href=\"https:\/\/www.studytime.xin\/article\/#stage\u7c7b\u578b\" title=\"stage\u7c7b\u578b\"><\/a>stage\u7c7b\u578b<\/h3>\n<h4><a href=\"https:\/\/www.studytime.xin\/article\/#ShuffleMapStage\" title=\"ShuffleMapStage\"><\/a>ShuffleMapStage<\/h4>\n<p>\u6700\u540e\u4e00\u4e2ashuffle\u4e4b\u524d\u7684\u6240\u6709\u53d8\u6362\u7684Stage\u53ebShuffleMapStage\uff0c\u5bf9\u5e94\u7684task\u662fshuffleMapTask\u3002<\/p>\n<h4><a href=\"https:\/\/www.studytime.xin\/article\/#ResultStag\" title=\"ResultStag\"><\/a>ResultStag<\/h4>\n<p>\u6700\u540e\u4e00\u4e2ashuffle\u4e4b\u540e\u64cd\u4f5c\u7684Stage\u53ebResultStage\uff0c\u5b83\u662f\u6700\u540e\u4e00\u4e2aStage\u3002\u5b83\u5bf9\u5e94\u7684task\u662fResultTask.<\/p>\n<h3><a href=\"https:\/\/www.studytime.xin\/article\/#\u4e3a\u4ec0\u4e48\u8981\u5212\u5206stage\" title=\"\u4e3a\u4ec0\u4e48\u8981\u5212\u5206stage\"><\/a>\u4e3a\u4ec0\u4e48\u8981\u5212\u5206stage<\/h3>\n<p>\u6839\u636eRDD\u4e4b\u95f4\u4f9d\u8d56\u5173\u7cfb\u7684\u4e0d\u540c\u5c06DAG\u5212\u5206\u6210\u4e0d\u540c\u7684Stage(\u8c03\u5ea6\u9636\u6bb5)<br \/>\u5bf9\u4e8e\u7a84\u4f9d\u8d56\uff0cpartition\u7684\u8f6c\u6362\u5904\u7406\u5728\u4e00\u4e2aStage\u4e2d\u5b8c\u6210\u8ba1\u7b97<br \/>\u5bf9\u4e8e\u5bbd\u4f9d\u8d56\uff0c\u7531\u4e8e\u6709Shuffle\u7684\u5b58\u5728\uff0c\u53ea\u80fd\u5728parent RDD\u5904\u7406\u5b8c\u6210\u540e\uff0c\u624d\u80fd\u5f00\u59cb\u63a5\u4e0b\u6765\u7684\u8ba1\u7b97\uff0c<\/p>\n<p>\u7531\u4e8e\u5212\u5206\u5b8cstage\u4e4b\u540e\uff0c\u5728\u540c\u4e00\u4e2astage\u4e2d\u53ea\u6709\u7a84\u4f9d\u8d56\uff0c\u6ca1\u6709\u5bbd\u4f9d\u8d56\uff0c\u53ef\u4ee5\u5b9e\u73b0\u6d41\u6c34\u7ebf\u8ba1\u7b97\uff0c<br \/>stage\u4e2d\u7684\u6bcf\u4e00\u4e2a\u5206\u533a\u5bf9\u5e94\u4e00\u4e2atask\uff0c\u5728\u540c\u4e00\u4e2astage\u4e2d\u5c31\u6709\u5f88\u591a\u53ef\u4ee5\u5e76\u884c\u8fd0\u884c\u7684task\u3002<\/p>\n<h3><a href=\"https:\/\/www.studytime.xin\/article\/#\u5982\u4f55\u5212\u5206stage\" title=\"\u5982\u4f55\u5212\u5206stage\"><\/a>\u5982\u4f55\u5212\u5206stage<\/h3>\n<h4><a href=\"https:\/\/www.studytime.xin\/article\/#\u5212\u5206stage\u7684\u4f9d\u636e\u5c31\u662f\u5bbd\u4f9d\u8d56\" title=\"\u5212\u5206stage\u7684\u4f9d\u636e\u5c31\u662f\u5bbd\u4f9d\u8d56\"><\/a>\u5212\u5206stage\u7684\u4f9d\u636e\u5c31\u662f\u5bbd\u4f9d\u8d56<\/h4>\n<ul>\n<li>\u9996\u5148\u6839\u636erdd\u7684\u7b97\u5b50\u64cd\u4f5c\u987a\u5e8f\u751f\u6210DAG\u6709\u5411\u65e0\u73af\u56fe\uff0c\u63a5\u4e0b\u91cc\u4ece\u6700\u540e\u4e00\u4e2ardd\u5f80\u524d\u63a8\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684stage\uff0c\u628a\u8be5rdd\u52a0\u5165\u5230\u8be5stage\u4e2d\uff0c\u5b83\u662f\u6700\u540e\u4e00\u4e2astage\u3002<\/li>\n<li>\u5728\u5f80\u524d\u63a8\u7684\u8fc7\u7a0b\u4e2d\u8fd0\u884c\u9047\u5230\u4e86\u7a84\u4f9d\u8d56\u5c31\u628a\u8be5rdd\u52a0\u5165\u5230\u672cstage\u4e2d\uff0c\u5982\u679c\u9047\u5230\u4e86\u5bbd\u4f9d\u8d56\uff0c\u5c31\u4ece\u5bbd\u4f9d\u8d56\u5207\u5f00\uff0c\u90a3\u4e48\u6700\u540e\u4e00\u4e2astage\u4e5f\u5c31\u7ed3\u675f\u4e86\u3002<\/li>\n<li>\u91cd\u65b0\u521b\u5efa\u4e00\u4e2a\u65b0\u7684stage\uff0c\u6309\u7167\u7b2c\u4e8c\u4e2a\u6b65\u9aa4\u7ee7\u7eed\u5f80\u524d\u63a8\uff0c\u4e00\u76f4\u5230\u6700\u5f00\u59cb\u7684rdd\uff0c\u6574\u4e2a\u5212\u5206stage\u4e5f\u5c31\u7ed3\u675f\u4e86<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/08\/20200803_5f28422c30843.png\" alt=\"Spark RDD\u7684\u4f9d\u8d56\u5173\u7cfb\u4ee5\u53caDAG\u5212\u5206stage\"><\/p>\n<h3><a href=\"https:\/\/www.studytime.xin\/article\/#stage\u4e0estage\u4e4b\u95f4\u7684\u5173\u7cfb\" title=\"stage\u4e0estage\u4e4b\u95f4\u7684\u5173\u7cfb\"><\/a>stage\u4e0estage\u4e4b\u95f4\u7684\u5173\u7cfb<\/h3>\n<p>\u5212\u5206\u5b8cstage\u4e4b\u540e\uff0c\u6bcf\u4e00\u4e2astage\u4e2d\u6709\u5f88\u591a\u53ef\u4ee5\u5e76\u884c\u8fd0\u884c\u7684task\uff0c\u540e\u671f\u628a\u6bcf\u4e00\u4e2astage\u4e2d\u7684task\u5c01\u88c5\u5728\u4e00\u4e2ataskSet\u96c6\u5408\u4e2d\uff0c\u6700\u540e\u628a\u4e00\u4e2a\u4e00\u4e2a\u7684taskSet\u96c6\u5408\u63d0\u4ea4\u5230worker\u8282\u70b9\u4e0a\u7684executor\u8fdb\u7a0b\u4e2d\u8fd0\u884c\u3002<\/p>\n<p>rdd\u4e0erdd\u4e4b\u95f4\u5b58\u5728\u4f9d\u8d56\u5173\u7cfb\uff0cstage\u4e0estage\u4e4b\u524d\u4e5f\u5b58\u5728\u4f9d\u8d56\u5173\u7cfb\uff0c\u524d\u9762stage\u4e2d\u7684task\u5148\u8fd0\u884c\uff0c\u8fd0\u884c\u5b8c\u6210\u4e86\u518d\u8fd0\u884c\u540e\u9762stage\u4e2d\u7684task\uff0c\u4e5f\u5c31\u662f\u8bf4\u540e\u9762stage\u4e2d\u7684task\u8f93\u5165\u6570\u636e\u662f\u524d\u9762stage\u4e2dtask\u7684\u8f93\u51fa\u7ed3\u679c\u6570\u636e\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/08\/20200803_5f284233b90ef.png\" alt=\"Spark RDD\u7684\u4f9d\u8d56\u5173\u7cfb\u4ee5\u53caDAG\u5212\u5206stage\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>RDD \u7684\u5bbd\u4f9d\u8d56\u548c\u7a84\u4f9d\u8d56 \u7531\u4e8e R&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/142523"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=142523"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/142523\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=142523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=142523"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=142523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}