{"action":"created","comment":{"url":"https://api.github.com/repos/amplab/tachyon/pulls/comments/47062598","id":47062598,"diff_hunk":"@@ -200,37 +242,54 @@ private void requestMasterContainer() throws Exception {\n     if (!mMasterAddress.equals(\"localhost\")) {\n       relaxLocality = false;\n     }\n-    ContainerRequest masterContainerAsk =\n-        new ContainerRequest(masterResource, nodes, null /* any racks */, PRIORITY, relaxLocality);\n+    ContainerRequest masterContainerAsk = new ContainerRequest(masterResource, nodes,\n+        null /* any racks */, MASTER_PRIORITY, relaxLocality);\n     LOG.info(\"Making resource request for Tachyon master: cpu {} memory {} MB on node {}\",\n         masterResource.getVirtualCores(), masterResource.getMemory(), mMasterAddress);\n     mRMClient.addContainerRequest(masterContainerAsk);\n \n-    // Wait until Tachyon master container has been allocated\n+    LOG.info(\"Waiting for master container to be allocated\");\n     mMasterContainerAllocatedLatch.await();\n   }\n \n   /**\n-   * Requests containers for the workers and waits for them all to be allocated.\n+   * Requests containers for the workers, attempting to get containers on separate nodes.\n    */\n   private void requestWorkerContainers() throws Exception {\n+    LOG.info(\"Requesting worker containers\");\n     // Resource requirements for worker containers\n     Resource workerResource = Records.newRecord(Resource.class);\n     workerResource.setMemory(mWorkerMemInMB + mRamdiskMemInMB);\n     workerResource.setVirtualCores(mWorkerCpu);\n+    int currentNumWorkers;\n+    synchronized (mWorkerHosts) {\n+      currentNumWorkers = mWorkerHosts.size();\n+    }\n \n     // Make container requests for workers to ResourceManager\n-    for (int i = 0; i < mNumWorkers; i ++) {\n-      ContainerRequest containerAsk =\n-          new ContainerRequest(workerResource, null /* any hosts */, null /* any racks */,\n-              PRIORITY);\n-      LOG.info(\"Making resource request for Tachyon worker {}: cpu {} memory {} MB on any nodes\",\n-          i, workerResource.getVirtualCores(), workerResource.getMemory());\n+    for (int i = currentNumWorkers; i < mNumWorkers; i ++) {\n+      ContainerRequest containerAsk = new ContainerRequest(workerResource, getUnusedWorkerHosts(),","path":"integration/yarn/src/main/java/tachyon/yarn/ApplicationMaster.java","position":190,"original_position":190,"commit_id":"beba8a678157e800fb471855caefe3299a64bb89","original_commit_id":"beba8a678157e800fb471855caefe3299a64bb89","user":{"login":"apc999","id":1413748,"avatar_url":"https://avatars.githubusercontent.com/u/1413748?v=3","gravatar_id":"","url":"https://api.github.com/users/apc999","html_url":"https://github.com/apc999","followers_url":"https://api.github.com/users/apc999/followers","following_url":"https://api.github.com/users/apc999/following{/other_user}","gists_url":"https://api.github.com/users/apc999/gists{/gist_id}","starred_url":"https://api.github.com/users/apc999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apc999/subscriptions","organizations_url":"https://api.github.com/users/apc999/orgs","repos_url":"https://api.github.com/users/apc999/repos","events_url":"https://api.github.com/users/apc999/events{/privacy}","received_events_url":"https://api.github.com/users/apc999/received_events","type":"User","site_admin":false},"body":"shall we check if `getUnusedWorkerHosts()` returns an empty list which I think is possible. \r\nIn that case, we could probably abort this attempt.","created_at":"2015-12-09T08:35:12Z","updated_at":"2015-12-09T08:35:12Z","html_url":"https://github.com/amplab/tachyon/pull/2243#discussion_r47062598","pull_request_url":"https://api.github.com/repos/amplab/tachyon/pulls/2243","_links":{"self":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/comments/47062598"},"html":{"href":"https://github.com/amplab/tachyon/pull/2243#discussion_r47062598"},"pull_request":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/2243"}}},"pull_request":{"url":"https://api.github.com/repos/amplab/tachyon/pulls/2243","id":53056707,"html_url":"https://github.com/amplab/tachyon/pull/2243","diff_url":"https://github.com/amplab/tachyon/pull/2243.diff","patch_url":"https://github.com/amplab/tachyon/pull/2243.patch","issue_url":"https://api.github.com/repos/amplab/tachyon/issues/2243","number":2243,"state":"open","locked":false,"title":"[TACHYON-1406] Avoid allocating multiple workers on the same host","user":{"login":"aaudiber","id":3455177,"avatar_url":"https://avatars.githubusercontent.com/u/3455177?v=3","gravatar_id":"","url":"https://api.github.com/users/aaudiber","html_url":"https://github.com/aaudiber","followers_url":"https://api.github.com/users/aaudiber/followers","following_url":"https://api.github.com/users/aaudiber/following{/other_user}","gists_url":"https://api.github.com/users/aaudiber/gists{/gist_id}","starred_url":"https://api.github.com/users/aaudiber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaudiber/subscriptions","organizations_url":"https://api.github.com/users/aaudiber/orgs","repos_url":"https://api.github.com/users/aaudiber/repos","events_url":"https://api.github.com/users/aaudiber/events{/privacy}","received_events_url":"https://api.github.com/users/aaudiber/received_events","type":"User","site_admin":false},"body":"https://tachyon.atlassian.net/browse/TACHYON-1406","created_at":"2015-12-08T23:44:07Z","updated_at":"2015-12-09T08:35:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d077b327daa0ce440ca5b59b8d50e09556db5038","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/amplab/tachyon/pulls/2243/commits","review_comments_url":"https://api.github.com/repos/amplab/tachyon/pulls/2243/comments","review_comment_url":"https://api.github.com/repos/amplab/tachyon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/amplab/tachyon/issues/2243/comments","statuses_url":"https://api.github.com/repos/amplab/tachyon/statuses/beba8a678157e800fb471855caefe3299a64bb89","head":{"label":"aaudiber:unique-client-hosts-yarn","ref":"unique-client-hosts-yarn","sha":"beba8a678157e800fb471855caefe3299a64bb89","user":{"login":"aaudiber","id":3455177,"avatar_url":"https://avatars.githubusercontent.com/u/3455177?v=3","gravatar_id":"","url":"https://api.github.com/users/aaudiber","html_url":"https://github.com/aaudiber","followers_url":"https://api.github.com/users/aaudiber/followers","following_url":"https://api.github.com/users/aaudiber/following{/other_user}","gists_url":"https://api.github.com/users/aaudiber/gists{/gist_id}","starred_url":"https://api.github.com/users/aaudiber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaudiber/subscriptions","organizations_url":"https://api.github.com/users/aaudiber/orgs","repos_url":"https://api.github.com/users/aaudiber/repos","events_url":"https://api.github.com/users/aaudiber/events{/privacy}","received_events_url":"https://api.github.com/users/aaudiber/received_events","type":"User","site_admin":false},"repo":{"id":42785459,"name":"tachyon","full_name":"aaudiber/tachyon","owner":{"login":"aaudiber","id":3455177,"avatar_url":"https://avatars.githubusercontent.com/u/3455177?v=3","gravatar_id":"","url":"https://api.github.com/users/aaudiber","html_url":"https://github.com/aaudiber","followers_url":"https://api.github.com/users/aaudiber/followers","following_url":"https://api.github.com/users/aaudiber/following{/other_user}","gists_url":"https://api.github.com/users/aaudiber/gists{/gist_id}","starred_url":"https://api.github.com/users/aaudiber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaudiber/subscriptions","organizations_url":"https://api.github.com/users/aaudiber/orgs","repos_url":"https://api.github.com/users/aaudiber/repos","events_url":"https://api.github.com/users/aaudiber/events{/privacy}","received_events_url":"https://api.github.com/users/aaudiber/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aaudiber/tachyon","description":"Memory Centric Reliable Distributed Storage","fork":true,"url":"https://api.github.com/repos/aaudiber/tachyon","forks_url":"https://api.github.com/repos/aaudiber/tachyon/forks","keys_url":"https://api.github.com/repos/aaudiber/tachyon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aaudiber/tachyon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aaudiber/tachyon/teams","hooks_url":"https://api.github.com/repos/aaudiber/tachyon/hooks","issue_events_url":"https://api.github.com/repos/aaudiber/tachyon/issues/events{/number}","events_url":"https://api.github.com/repos/aaudiber/tachyon/events","assignees_url":"https://api.github.com/repos/aaudiber/tachyon/assignees{/user}","branches_url":"https://api.github.com/repos/aaudiber/tachyon/branches{/branch}","tags_url":"https://api.github.com/repos/aaudiber/tachyon/tags","blobs_url":"https://api.github.com/repos/aaudiber/tachyon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aaudiber/tachyon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aaudiber/tachyon/git/refs{/sha}","trees_url":"https://api.github.com/repos/aaudiber/tachyon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aaudiber/tachyon/statuses/{sha}","languages_url":"https://api.github.com/repos/aaudiber/tachyon/languages","stargazers_url":"https://api.github.com/repos/aaudiber/tachyon/stargazers","contributors_url":"https://api.github.com/repos/aaudiber/tachyon/contributors","subscribers_url":"https://api.github.com/repos/aaudiber/tachyon/subscribers","subscription_url":"https://api.github.com/repos/aaudiber/tachyon/subscription","commits_url":"https://api.github.com/repos/aaudiber/tachyon/commits{/sha}","git_commits_url":"https://api.github.com/repos/aaudiber/tachyon/git/commits{/sha}","comments_url":"https://api.github.com/repos/aaudiber/tachyon/comments{/number}","issue_comment_url":"https://api.github.com/repos/aaudiber/tachyon/issues/comments{/number}","contents_url":"https://api.github.com/repos/aaudiber/tachyon/contents/{+path}","compare_url":"https://api.github.com/repos/aaudiber/tachyon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aaudiber/tachyon/merges","archive_url":"https://api.github.com/repos/aaudiber/tachyon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aaudiber/tachyon/downloads","issues_url":"https://api.github.com/repos/aaudiber/tachyon/issues{/number}","pulls_url":"https://api.github.com/repos/aaudiber/tachyon/pulls{/number}","milestones_url":"https://api.github.com/repos/aaudiber/tachyon/milestones{/number}","notifications_url":"https://api.github.com/repos/aaudiber/tachyon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aaudiber/tachyon/labels{/name}","releases_url":"https://api.github.com/repos/aaudiber/tachyon/releases{/id}","created_at":"2015-09-19T18:48:47Z","updated_at":"2015-09-19T18:48:49Z","pushed_at":"2015-12-09T01:58:57Z","git_url":"git://github.com/aaudiber/tachyon.git","ssh_url":"git@github.com:aaudiber/tachyon.git","clone_url":"https://github.com/aaudiber/tachyon.git","svn_url":"https://github.com/aaudiber/tachyon","homepage":"http://tachyon-project.org","size":32745,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"amplab:master","ref":"master","sha":"615dfe1431cd6dca9e6fdd5b6191016b672a6775","user":{"login":"amplab","id":1438454,"avatar_url":"https://avatars.githubusercontent.com/u/1438454?v=3","gravatar_id":"","url":"https://api.github.com/users/amplab","html_url":"https://github.com/amplab","followers_url":"https://api.github.com/users/amplab/followers","following_url":"https://api.github.com/users/amplab/following{/other_user}","gists_url":"https://api.github.com/users/amplab/gists{/gist_id}","starred_url":"https://api.github.com/users/amplab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amplab/subscriptions","organizations_url":"https://api.github.com/users/amplab/orgs","repos_url":"https://api.github.com/users/amplab/repos","events_url":"https://api.github.com/users/amplab/events{/privacy}","received_events_url":"https://api.github.com/users/amplab/received_events","type":"Organization","site_admin":false},"repo":{"id":7276954,"name":"tachyon","full_name":"amplab/tachyon","owner":{"login":"amplab","id":1438454,"avatar_url":"https://avatars.githubusercontent.com/u/1438454?v=3","gravatar_id":"","url":"https://api.github.com/users/amplab","html_url":"https://github.com/amplab","followers_url":"https://api.github.com/users/amplab/followers","following_url":"https://api.github.com/users/amplab/following{/other_user}","gists_url":"https://api.github.com/users/amplab/gists{/gist_id}","starred_url":"https://api.github.com/users/amplab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amplab/subscriptions","organizations_url":"https://api.github.com/users/amplab/orgs","repos_url":"https://api.github.com/users/amplab/repos","events_url":"https://api.github.com/users/amplab/events{/privacy}","received_events_url":"https://api.github.com/users/amplab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/amplab/tachyon","description":"Memory Centric Reliable Distributed Storage","fork":false,"url":"https://api.github.com/repos/amplab/tachyon","forks_url":"https://api.github.com/repos/amplab/tachyon/forks","keys_url":"https://api.github.com/repos/amplab/tachyon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amplab/tachyon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amplab/tachyon/teams","hooks_url":"https://api.github.com/repos/amplab/tachyon/hooks","issue_events_url":"https://api.github.com/repos/amplab/tachyon/issues/events{/number}","events_url":"https://api.github.com/repos/amplab/tachyon/events","assignees_url":"https://api.github.com/repos/amplab/tachyon/assignees{/user}","branches_url":"https://api.github.com/repos/amplab/tachyon/branches{/branch}","tags_url":"https://api.github.com/repos/amplab/tachyon/tags","blobs_url":"https://api.github.com/repos/amplab/tachyon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amplab/tachyon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amplab/tachyon/git/refs{/sha}","trees_url":"https://api.github.com/repos/amplab/tachyon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amplab/tachyon/statuses/{sha}","languages_url":"https://api.github.com/repos/amplab/tachyon/languages","stargazers_url":"https://api.github.com/repos/amplab/tachyon/stargazers","contributors_url":"https://api.github.com/repos/amplab/tachyon/contributors","subscribers_url":"https://api.github.com/repos/amplab/tachyon/subscribers","subscription_url":"https://api.github.com/repos/amplab/tachyon/subscription","commits_url":"https://api.github.com/repos/amplab/tachyon/commits{/sha}","git_commits_url":"https://api.github.com/repos/amplab/tachyon/git/commits{/sha}","comments_url":"https://api.github.com/repos/amplab/tachyon/comments{/number}","issue_comment_url":"https://api.github.com/repos/amplab/tachyon/issues/comments{/number}","contents_url":"https://api.github.com/repos/amplab/tachyon/contents/{+path}","compare_url":"https://api.github.com/repos/amplab/tachyon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amplab/tachyon/merges","archive_url":"https://api.github.com/repos/amplab/tachyon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amplab/tachyon/downloads","issues_url":"https://api.github.com/repos/amplab/tachyon/issues{/number}","pulls_url":"https://api.github.com/repos/amplab/tachyon/pulls{/number}","milestones_url":"https://api.github.com/repos/amplab/tachyon/milestones{/number}","notifications_url":"https://api.github.com/repos/amplab/tachyon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amplab/tachyon/labels{/name}","releases_url":"https://api.github.com/repos/amplab/tachyon/releases{/id}","created_at":"2012-12-21T17:43:46Z","updated_at":"2015-12-09T08:17:44Z","pushed_at":"2015-12-09T05:27:51Z","git_url":"git://github.com/amplab/tachyon.git","ssh_url":"git@github.com:amplab/tachyon.git","clone_url":"https://github.com/amplab/tachyon.git","svn_url":"https://github.com/amplab/tachyon","homepage":"http://tachyon-project.org","size":40738,"stargazers_count":1792,"watchers_count":1792,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":709,"mirror_url":null,"open_issues_count":26,"forks":709,"open_issues":26,"watchers":1792,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/2243"},"html":{"href":"https://github.com/amplab/tachyon/pull/2243"},"issue":{"href":"https://api.github.com/repos/amplab/tachyon/issues/2243"},"comments":{"href":"https://api.github.com/repos/amplab/tachyon/issues/2243/comments"},"review_comments":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/2243/comments"},"review_comment":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/2243/commits"},"statuses":{"href":"https://api.github.com/repos/amplab/tachyon/statuses/beba8a678157e800fb471855caefe3299a64bb89"}}}}