{"action":"closed","number":3765,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/3765","id":26482168,"html_url":"https://github.com/apache/spark/pull/3765","diff_url":"https://github.com/apache/spark/pull/3765.diff","patch_url":"https://github.com/apache/spark/pull/3765.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/3765","number":3765,"state":"closed","locked":false,"title":"SPARK-1714. Take advantage of AMRMClient APIs to simplify logic in YarnA...","user":{"login":"sryza","id":654855,"avatar_url":"https://avatars.githubusercontent.com/u/654855?v=3","gravatar_id":"","url":"https://api.github.com/users/sryza","html_url":"https://github.com/sryza","followers_url":"https://api.github.com/users/sryza/followers","following_url":"https://api.github.com/users/sryza/following{/other_user}","gists_url":"https://api.github.com/users/sryza/gists{/gist_id}","starred_url":"https://api.github.com/users/sryza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sryza/subscriptions","organizations_url":"https://api.github.com/users/sryza/orgs","repos_url":"https://api.github.com/users/sryza/repos","events_url":"https://api.github.com/users/sryza/events{/privacy}","received_events_url":"https://api.github.com/users/sryza/received_events","type":"User","site_admin":false},"body":"...llocator\r\n\r\nThe goal of this PR is to simplify YarnAllocator as much as possible and get it up to the level of code quality we see in the rest of Spark.\r\n\r\nIn service of this, it does a few things:\r\n* Uses AMRMClient APIs for matching containers to requests.\r\n* Adds calls to AMRMClient.removeContainerRequest so that, when we use a container, we don't end up requesting it again.\r\n* Removes YarnAllocator's host->rack cache. YARN's RackResolver already does this caching, so this is redundant.\r\n* Adds tests for basic YarnAllocator functionality.\r\n* Breaks up the allocateResources method, which was previously nearly 300 lines.\r\n* A little bit of stylistic cleanup.\r\n* Fixes a bug that causes three times the requests to be filed when preferred host locations are given.\r\n\r\nThe patch is lossy. In particular, it loses the logic for trying to avoid containers bunching up on nodes. As I understand it, the logic that's gone is:\r\n\r\n* If, in a single response from the RM, we receive a set of containers on a node, and prefer some number of containers on that node greater than 0 but less than the number we received, give back the delta between what we preferred and what we received.\r\n\r\nThis seems like a weird way to avoid bunching E.g. it does nothing to avoid bunching when we don't request containers on particular nodes.\r\n","created_at":"2014-12-22T21:30:55Z","updated_at":"2015-01-21T16:32:47Z","closed_at":"2015-01-21T16:32:47Z","merged_at":null,"merge_commit_sha":"744a747479aeb3c5134c63fea47d503245439d30","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/3765/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/3765/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments/{number}","comments_url":"https://api.github.com/repos/apache/spark/issues/3765/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/32a594295e97f74bda48dfb026bbb842163607ae","head":{"label":"sryza:sandy-spark-1714","ref":"sandy-spark-1714","sha":"32a594295e97f74bda48dfb026bbb842163607ae","user":{"login":"sryza","id":654855,"avatar_url":"https://avatars.githubusercontent.com/u/654855?v=3","gravatar_id":"","url":"https://api.github.com/users/sryza","html_url":"https://github.com/sryza","followers_url":"https://api.github.com/users/sryza/followers","following_url":"https://api.github.com/users/sryza/following{/other_user}","gists_url":"https://api.github.com/users/sryza/gists{/gist_id}","starred_url":"https://api.github.com/users/sryza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sryza/subscriptions","organizations_url":"https://api.github.com/users/sryza/orgs","repos_url":"https://api.github.com/users/sryza/repos","events_url":"https://api.github.com/users/sryza/events{/privacy}","received_events_url":"https://api.github.com/users/sryza/received_events","type":"User","site_admin":false},"repo":{"id":17230980,"name":"spark","full_name":"sryza/spark","owner":{"login":"sryza","id":654855,"avatar_url":"https://avatars.githubusercontent.com/u/654855?v=3","gravatar_id":"","url":"https://api.github.com/users/sryza","html_url":"https://github.com/sryza","followers_url":"https://api.github.com/users/sryza/followers","following_url":"https://api.github.com/users/sryza/following{/other_user}","gists_url":"https://api.github.com/users/sryza/gists{/gist_id}","starred_url":"https://api.github.com/users/sryza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sryza/subscriptions","organizations_url":"https://api.github.com/users/sryza/orgs","repos_url":"https://api.github.com/users/sryza/repos","events_url":"https://api.github.com/users/sryza/events{/privacy}","received_events_url":"https://api.github.com/users/sryza/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sryza/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/sryza/spark","forks_url":"https://api.github.com/repos/sryza/spark/forks","keys_url":"https://api.github.com/repos/sryza/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sryza/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sryza/spark/teams","hooks_url":"https://api.github.com/repos/sryza/spark/hooks","issue_events_url":"https://api.github.com/repos/sryza/spark/issues/events{/number}","events_url":"https://api.github.com/repos/sryza/spark/events","assignees_url":"https://api.github.com/repos/sryza/spark/assignees{/user}","branches_url":"https://api.github.com/repos/sryza/spark/branches{/branch}","tags_url":"https://api.github.com/repos/sryza/spark/tags","blobs_url":"https://api.github.com/repos/sryza/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sryza/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sryza/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/sryza/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sryza/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/sryza/spark/languages","stargazers_url":"https://api.github.com/repos/sryza/spark/stargazers","contributors_url":"https://api.github.com/repos/sryza/spark/contributors","subscribers_url":"https://api.github.com/repos/sryza/spark/subscribers","subscription_url":"https://api.github.com/repos/sryza/spark/subscription","commits_url":"https://api.github.com/repos/sryza/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/sryza/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/sryza/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/sryza/spark/issues/comments/{number}","contents_url":"https://api.github.com/repos/sryza/spark/contents/{+path}","compare_url":"https://api.github.com/repos/sryza/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sryza/spark/merges","archive_url":"https://api.github.com/repos/sryza/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sryza/spark/downloads","issues_url":"https://api.github.com/repos/sryza/spark/issues{/number}","pulls_url":"https://api.github.com/repos/sryza/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/sryza/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/sryza/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sryza/spark/labels{/name}","releases_url":"https://api.github.com/repos/sryza/spark/releases{/id}","created_at":"2014-02-27T00:28:05Z","updated_at":"2014-06-25T08:18:09Z","pushed_at":"2015-01-21T00:23:55Z","git_url":"git://github.com/sryza/spark.git","ssh_url":"git@github.com:sryza/spark.git","clone_url":"https://github.com/sryza/spark.git","svn_url":"https://github.com/sryza/spark","homepage":null,"size":86361,"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":"bc20a52b34e826895d0dcc1d783c021ebd456ebd","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-01-21T16:32:13Z","pushed_at":"2015-01-21T16:32:12Z","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":1142009,"stargazers_count":2616,"watchers_count":2616,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2315,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":304,"forks":2315,"open_issues":304,"watchers":2616,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/3765"},"html":{"href":"https://github.com/apache/spark/pull/3765"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/3765"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/3765/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/3765/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/3765/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/32a594295e97f74bda48dfb026bbb842163607ae"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":23,"review_comments":22,"commits":9,"additions":389,"deletions":550,"changed_files":7}}