{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/25058302","id":25058302,"diff_hunk":"@@ -912,6 +959,196 @@ class DAGScheduler(\n   }\n \n   /**\n+   * Helper function to handle stage completion\n+   * @param stage\n+   * @param errorMessage\n+   * @return\n+   */\n+  private def markStageAsFinished(stage: Stage, errorMessage: Option[String] = None) = {\n+    val serviceTime = stage.latestInfo.submissionTime match {\n+      case Some(t) => \"%.03f\".format((clock.getTime() - t) / 1000.0)\n+      case _ => \"Unknown\"\n+    }\n+    if (errorMessage.isEmpty) {\n+      logInfo(\"%s (%s) finished in %s s\".format(stage, stage.name, serviceTime))\n+      stage.latestInfo.completionTime = Some(clock.getTime())\n+    } else {\n+      stage.latestInfo.stageFailed(errorMessage.get)\n+      logInfo(\"%s (%s) failed in %s s\".format(stage, stage.name, serviceTime))\n+    }\n+    listenerBus.post(SparkListenerStageCompleted(stage.latestInfo))\n+    runningStages -= stage\n+  }\n+\n+  /**\n+   * Helper functino to process a ResultTask completion","path":"core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala","position":494,"original_position":494,"commit_id":"00182c7e7f9a38d5eee86065171804acc52e6d2a","original_commit_id":"00182c7e7f9a38d5eee86065171804acc52e6d2a","user":{"login":"markhamstra","id":424186,"avatar_url":"https://avatars.githubusercontent.com/u/424186?v=3","gravatar_id":"","url":"https://api.github.com/users/markhamstra","html_url":"https://github.com/markhamstra","followers_url":"https://api.github.com/users/markhamstra/followers","following_url":"https://api.github.com/users/markhamstra/following{/other_user}","gists_url":"https://api.github.com/users/markhamstra/gists{/gist_id}","starred_url":"https://api.github.com/users/markhamstra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markhamstra/subscriptions","organizations_url":"https://api.github.com/users/markhamstra/orgs","repos_url":"https://api.github.com/users/markhamstra/repos","events_url":"https://api.github.com/users/markhamstra/events{/privacy}","received_events_url":"https://api.github.com/users/markhamstra/received_events","type":"User","site_admin":false},"body":"typo","created_at":"2015-02-20T09:27:55Z","updated_at":"2015-02-20T09:27:55Z","html_url":"https://github.com/apache/spark/pull/4703#discussion_r25058302","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/4703","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/25058302"},"html":{"href":"https://github.com/apache/spark/pull/4703#discussion_r25058302"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/4703"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/4703","id":29678102,"html_url":"https://github.com/apache/spark/pull/4703","diff_url":"https://github.com/apache/spark/pull/4703.diff","patch_url":"https://github.com/apache/spark/pull/4703.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/4703","number":4703,"state":"open","locked":false,"title":"[SPARK-4655] Split Stage into ShuffleMapStage and ResultStage subclasses","user":{"login":"ilganeli","id":1483345,"avatar_url":"https://avatars.githubusercontent.com/u/1483345?v=3","gravatar_id":"","url":"https://api.github.com/users/ilganeli","html_url":"https://github.com/ilganeli","followers_url":"https://api.github.com/users/ilganeli/followers","following_url":"https://api.github.com/users/ilganeli/following{/other_user}","gists_url":"https://api.github.com/users/ilganeli/gists{/gist_id}","starred_url":"https://api.github.com/users/ilganeli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilganeli/subscriptions","organizations_url":"https://api.github.com/users/ilganeli/orgs","repos_url":"https://api.github.com/users/ilganeli/repos","events_url":"https://api.github.com/users/ilganeli/events{/privacy}","received_events_url":"https://api.github.com/users/ilganeli/received_events","type":"User","site_admin":false},"body":"Hi all - this patch includes two main efforts:\r\n\r\n1) I've split up Stage into ShuffleMapStage and ResultStage and updated their usage within DAGScheduler\r\n2) While doing this, I ended up cleaning up a lot of the long and awkward functions within the DAGScheduler since I needed to do that to make sense of the code. I believe this improved readability of the code significantly - the only problem is that it's not straightforward to diff those changes side by side (particularly the updates to handleFetchFailure(). \r\n\r\nI wanted to confirm that it's appropriate to move the outputLocs variable and its associated methods into ShuffleMapStage. The one function of concern is within the completeStage() and handleFailedTasks() functions where I wanted to confirm that we are guaranteed for that stage to be a ShuffleMapStage\r\n\r\nI believe I've split up the functionality of ResultStage and ShuffleMapStage appropriately but I wanted to make sure I'm not missing something.","created_at":"2015-02-20T07:47:41Z","updated_at":"2015-02-20T09:27:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/4703/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/4703/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments/{number}","comments_url":"https://api.github.com/repos/apache/spark/issues/4703/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/00182c7e7f9a38d5eee86065171804acc52e6d2a","head":{"label":"ilganeli:SPARK-4653","ref":"SPARK-4653","sha":"00182c7e7f9a38d5eee86065171804acc52e6d2a","user":{"login":"ilganeli","id":1483345,"avatar_url":"https://avatars.githubusercontent.com/u/1483345?v=3","gravatar_id":"","url":"https://api.github.com/users/ilganeli","html_url":"https://github.com/ilganeli","followers_url":"https://api.github.com/users/ilganeli/followers","following_url":"https://api.github.com/users/ilganeli/following{/other_user}","gists_url":"https://api.github.com/users/ilganeli/gists{/gist_id}","starred_url":"https://api.github.com/users/ilganeli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilganeli/subscriptions","organizations_url":"https://api.github.com/users/ilganeli/orgs","repos_url":"https://api.github.com/users/ilganeli/repos","events_url":"https://api.github.com/users/ilganeli/events{/privacy}","received_events_url":"https://api.github.com/users/ilganeli/received_events","type":"User","site_admin":false},"repo":{"id":24374828,"name":"spark","full_name":"ilganeli/spark","owner":{"login":"ilganeli","id":1483345,"avatar_url":"https://avatars.githubusercontent.com/u/1483345?v=3","gravatar_id":"","url":"https://api.github.com/users/ilganeli","html_url":"https://github.com/ilganeli","followers_url":"https://api.github.com/users/ilganeli/followers","following_url":"https://api.github.com/users/ilganeli/following{/other_user}","gists_url":"https://api.github.com/users/ilganeli/gists{/gist_id}","starred_url":"https://api.github.com/users/ilganeli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilganeli/subscriptions","organizations_url":"https://api.github.com/users/ilganeli/orgs","repos_url":"https://api.github.com/users/ilganeli/repos","events_url":"https://api.github.com/users/ilganeli/events{/privacy}","received_events_url":"https://api.github.com/users/ilganeli/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ilganeli/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/ilganeli/spark","forks_url":"https://api.github.com/repos/ilganeli/spark/forks","keys_url":"https://api.github.com/repos/ilganeli/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ilganeli/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ilganeli/spark/teams","hooks_url":"https://api.github.com/repos/ilganeli/spark/hooks","issue_events_url":"https://api.github.com/repos/ilganeli/spark/issues/events{/number}","events_url":"https://api.github.com/repos/ilganeli/spark/events","assignees_url":"https://api.github.com/repos/ilganeli/spark/assignees{/user}","branches_url":"https://api.github.com/repos/ilganeli/spark/branches{/branch}","tags_url":"https://api.github.com/repos/ilganeli/spark/tags","blobs_url":"https://api.github.com/repos/ilganeli/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ilganeli/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ilganeli/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/ilganeli/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ilganeli/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/ilganeli/spark/languages","stargazers_url":"https://api.github.com/repos/ilganeli/spark/stargazers","contributors_url":"https://api.github.com/repos/ilganeli/spark/contributors","subscribers_url":"https://api.github.com/repos/ilganeli/spark/subscribers","subscription_url":"https://api.github.com/repos/ilganeli/spark/subscription","commits_url":"https://api.github.com/repos/ilganeli/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/ilganeli/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/ilganeli/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/ilganeli/spark/issues/comments/{number}","contents_url":"https://api.github.com/repos/ilganeli/spark/contents/{+path}","compare_url":"https://api.github.com/repos/ilganeli/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ilganeli/spark/merges","archive_url":"https://api.github.com/repos/ilganeli/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ilganeli/spark/downloads","issues_url":"https://api.github.com/repos/ilganeli/spark/issues{/number}","pulls_url":"https://api.github.com/repos/ilganeli/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/ilganeli/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/ilganeli/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ilganeli/spark/labels{/name}","releases_url":"https://api.github.com/repos/ilganeli/spark/releases{/id}","created_at":"2014-09-23T14:30:54Z","updated_at":"2014-12-17T18:17:41Z","pushed_at":"2015-02-20T07:44:06Z","git_url":"git://github.com/ilganeli/spark.git","ssh_url":"git@github.com:ilganeli/spark.git","clone_url":"https://github.com/ilganeli/spark.git","svn_url":"https://github.com/ilganeli/spark","homepage":null,"size":90891,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"3be92cdac30cf488e09dbdaaa70e5c4cdaa9a099","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":17165658,"name":"spark","full_name":"apache/spark","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments/{number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","created_at":"2014-02-25T08:00:08Z","updated_at":"2015-02-20T08:41:28Z","pushed_at":"2015-02-20T08:20:29Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":1311774,"stargazers_count":2939,"watchers_count":2939,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2560,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":264,"forks":2560,"open_issues":264,"watchers":2939,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/4703"},"html":{"href":"https://github.com/apache/spark/pull/4703"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/4703"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/4703/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/4703/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/4703/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/00182c7e7f9a38d5eee86065171804acc52e6d2a"}}}}