GitHub PullRequestReviewCommentEvent at 2014-09-27 05:13:35
Repository: spark
Actor: andrewor14
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/18122064","id":18122064,"diff_hunk":"@@ -179,25 +176,22 @@ class CoarseGrainedSchedulerBackend(scheduler: TaskSchedulerImpl, actorSystem: A\n           }\n         }\n         else {\n-          freeCores(task.executorId) -= scheduler.CPUS_PER_TASK\n-          executorActor(task.executorId) ! LaunchTask(new SerializableBuffer(serializedTask))\n+          val executorInfo = executorDataMap(task.executorId)\n+          executorInfo.freeCores -= scheduler.CPUS_PER_TASK\n+          executorInfo.executorActor ! LaunchTask(new SerializableBuffer(serializedTask))\n         }\n       }\n     }\n \n     // Remove a disconnected slave from the cluster\n     def removeExecutor(executorId: String, reason: String) {\n-      if (executorActor.contains(executorId)) {\n-        logInfo(\"Executor \" + executorId + \" disconnected, so removing it\")\n-        val numCores = totalCores(executorId)\n-        executorActor -= executorId\n-        executorHost -= executorId\n-        addressToExecutorId -= executorAddress(executorId)\n-        executorAddress -= executorId\n-        totalCores -= executorId\n-        freeCores -= executorId\n-        totalCoreCount.addAndGet(-numCores)\n-        scheduler.executorLost(executorId, SlaveLost(reason))\n+      executorDataMap.get(executorId) match {\n+        case Some(executorInfo) =>\n+          val numCores = executorInfo.totalCores","path":"core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala","position":135,"original_position":135,"commit_id":"6890663c9b15914cfb8523b6cf26871c0f1c2727","original_commit_id":"6890663c9b15914cfb8523b6cf26871c0f1c2727","user":{"login":"andrewor14","id":2133137,"avatar_url":"https://avatars.githubusercontent.com/u/2133137?v=2","gravatar_id":"","url":"https://api.github.com/users/andrewor14","html_url":"https://github.com/andrewor14","followers_url":"https://api.github.com/users/andrewor14/followers","following_url":"https://api.github.com/users/andrewor14/following{/other_user}","gists_url":"https://api.github.com/users/andrewor14/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewor14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewor14/subscriptions","organizations_url":"https://api.github.com/users/andrewor14/orgs","repos_url":"https://api.github.com/users/andrewor14/repos","events_url":"https://api.github.com/users/andrewor14/events{/privacy}","received_events_url":"https://api.github.com/users/andrewor14/received_events","type":"User","site_admin":false},"body":"you probably don't need to put this in a val","created_at":"2014-09-27T05:13:35Z","updated_at":"2014-09-27T05:13:35Z","html_url":"https://github.com/apache/spark/pull/2533#discussion_r18122064","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/2533","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/18122064"},"html":{"href":"https://github.com/apache/spark/pull/2533#discussion_r18122064"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/2533"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/2533","id":21775104,"html_url":"https://github.com/apache/spark/pull/2533","diff_url":"https://github.com/apache/spark/pull/2533.diff","patch_url":"https://github.com/apache/spark/pull/2533.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/2533","number":2533,"state":"open","locked":false,"title":"SPARK-CORE [SPARK-3651] Group common CoarseGrainedSchedulerBackend variables together","user":{"login":"tigerquoll","id":8340922,"avatar_url":"https://avatars.githubusercontent.com/u/8340922?v=2","gravatar_id":"","url":"https://api.github.com/users/tigerquoll","html_url":"https://github.com/tigerquoll","followers_url":"https://api.github.com/users/tigerquoll/followers","following_url":"https://api.github.com/users/tigerquoll/following{/other_user}","gists_url":"https://api.github.com/users/tigerquoll/gists{/gist_id}","starred_url":"https://api.github.com/users/tigerquoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tigerquoll/subscriptions","organizations_url":"https://api.github.com/users/tigerquoll/orgs","repos_url":"https://api.github.com/users/tigerquoll/repos","events_url":"https://api.github.com/users/tigerquoll/events{/privacy}","received_events_url":"https://api.github.com/users/tigerquoll/received_events","type":"User","site_admin":false},"body":"from [SPARK-3651]\r\nIn CoarseGrainedSchedulerBackend, we have:\r\n\r\n    private val executorActor = new HashMap[String, ActorRef]\r\n    private val executorAddress = new HashMap[String, Address]\r\n    private val executorHost = new HashMap[String, String]\r\n    private val freeCores = new HashMap[String, Int]\r\n    private val totalCores = new HashMap[String, Int]\r\n\r\nWe only ever put / remove stuff from these maps together. It would simplify the code if we consolidate these all into one map as we have done in JobProgressListener in https://issues.apache.org/jira/browse/SPARK-2299.","created_at":"2014-09-25T10:59:27Z","updated_at":"2014-09-27T05:13:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f1c1cc3670f614cbbd898a3163d021cebe5109c1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/2533/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/2533/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments/{number}","comments_url":"https://api.github.com/repos/apache/spark/issues/2533/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/6890663c9b15914cfb8523b6cf26871c0f1c2727","head":{"label":"tigerquoll:SPARK-3651","ref":"SPARK-3651","sha":"6890663c9b15914cfb8523b6cf26871c0f1c2727","user":{"login":"tigerquoll","id":8340922,"avatar_url":"https://avatars.githubusercontent.com/u/8340922?v=2","gravatar_id":"","url":"https://api.github.com/users/tigerquoll","html_url":"https://github.com/tigerquoll","followers_url":"https://api.github.com/users/tigerquoll/followers","following_url":"https://api.github.com/users/tigerquoll/following{/other_user}","gists_url":"https://api.github.com/users/tigerquoll/gists{/gist_id}","starred_url":"https://api.github.com/users/tigerquoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tigerquoll/subscriptions","organizations_url":"https://api.github.com/users/tigerquoll/orgs","repos_url":"https://api.github.com/users/tigerquoll/repos","events_url":"https://api.github.com/users/tigerquoll/events{/privacy}","received_events_url":"https://api.github.com/users/tigerquoll/received_events","type":"User","site_admin":false},"repo":{"id":24401129,"name":"spark-tigerquoll","full_name":"tigerquoll/spark-tigerquoll","owner":{"login":"tigerquoll","id":8340922,"avatar_url":"https://avatars.githubusercontent.com/u/8340922?v=2","gravatar_id":"","url":"https://api.github.com/users/tigerquoll","html_url":"https://github.com/tigerquoll","followers_url":"https://api.github.com/users/tigerquoll/followers","following_url":"https://api.github.com/users/tigerquoll/following{/other_user}","gists_url":"https://api.github.com/users/tigerquoll/gists{/gist_id}","starred_url":"https://api.github.com/users/tigerquoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tigerquoll/subscriptions","organizations_url":"https://api.github.com/users/tigerquoll/orgs","repos_url":"https://api.github.com/users/tigerquoll/repos","events_url":"https://api.github.com/users/tigerquoll/events{/privacy}","received_events_url":"https://api.github.com/users/tigerquoll/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tigerquoll/spark-tigerquoll","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll","forks_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/forks","keys_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/teams","hooks_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/hooks","issue_events_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/issues/events{/number}","events_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/events","assignees_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/assignees{/user}","branches_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/branches{/branch}","tags_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/tags","blobs_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/git/refs{/sha}","trees_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/statuses/{sha}","languages_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/languages","stargazers_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/stargazers","contributors_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/contributors","subscribers_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/subscribers","subscription_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/subscription","commits_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/commits{/sha}","git_commits_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/git/commits{/sha}","comments_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/comments{/number}","issue_comment_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/issues/comments/{number}","contents_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/contents/{+path}","compare_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/merges","archive_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/downloads","issues_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/issues{/number}","pulls_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/pulls{/number}","milestones_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/milestones{/number}","notifications_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/labels{/name}","releases_url":"https://api.github.com/repos/tigerquoll/spark-tigerquoll/releases{/id}","created_at":"2014-09-24T04:48:11Z","updated_at":"2014-09-25T06:54:57Z","pushed_at":"2014-09-25T23:10:40Z","git_url":"git://github.com/tigerquoll/spark-tigerquoll.git","ssh_url":"git@github.com:tigerquoll/spark-tigerquoll.git","clone_url":"https://github.com/tigerquoll/spark-tigerquoll.git","svn_url":"https://github.com/tigerquoll/spark-tigerquoll","homepage":null,"size":77946,"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":"b8487713d3bf288a4f6fc149e6ee4cc8196d6e7d","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=2","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=2","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":"2014-09-26T21:33:29Z","pushed_at":"2014-09-27T04:46:22Z","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":3323569,"stargazers_count":1573,"watchers_count":1573,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1394,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":256,"forks":1394,"open_issues":256,"watchers":1573,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/2533"},"html":{"href":"https://github.com/apache/spark/pull/2533"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/2533"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/2533/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/2533/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/2533/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/6890663c9b15914cfb8523b6cf26871c0f1c2727"}}}}