{"action":"created","comment":{"url":"https://api.github.com/repos/Alluxio/alluxio/pulls/comments/80577291","id":80577291,"diff_hunk":"@@ -313,11 +227,50 @@ public static void releaseNettyChannel(InetSocketAddress address, Channel channe\n   }\n \n   /**\n+   * Acquires a block worker thrift client from the block worker thrift client pools.\n+   *\n+   * @param address the address of the block worker\n+   * @return the block worker thrift client\n+   * @throws IOException if it fails to connect to remote worker\n+   */\n+  public static BlockWorkerClientService.Client acquireBlockWorkerThriftClient(\n+      final InetSocketAddress address) throws IOException {\n+    if (!BLOCK_WORKER_THRIFT_CLIENT_POOL.containsKey(address)) {\n+      BlockWorkerThriftClientPool pool = new BlockWorkerThriftClientPool(address,\n+          Configuration.getInt(PropertyKey.USER_BLOCK_WORKER_CLIENT_POOL_SIZE_MAX),\n+          Configuration.getInt(PropertyKey.USER_BLOCK_WORKER_CLIENT_POOL_GC_THRESHOLD_SECS));\n+      if (BLOCK_WORKER_THRIFT_CLIENT_POOL.putIfAbsent(address, pool) != null) {\n+        pool.close();\n+      }\n+    }\n+    try {\n+      return BLOCK_WORKER_THRIFT_CLIENT_POOL.get(address).acquire();\n+    } catch (IOException e) {\n+      LOG.error(String.format(\"Failed to connect to block worker %s.\", address), e);","path":"core/client/src/main/java/alluxio/client/block/BlockStoreContext.java","position":250,"original_position":250,"commit_id":"76870059f56290da72799789e063f30156195f83","original_commit_id":"7fa89df7dbfa46e0add8838e7daebacadd83354b","user":{"login":"peisun1115","id":18294241,"avatar_url":"https://avatars.githubusercontent.com/u/18294241?v=3","gravatar_id":"","url":"https://api.github.com/users/peisun1115","html_url":"https://github.com/peisun1115","followers_url":"https://api.github.com/users/peisun1115/followers","following_url":"https://api.github.com/users/peisun1115/following{/other_user}","gists_url":"https://api.github.com/users/peisun1115/gists{/gist_id}","starred_url":"https://api.github.com/users/peisun1115/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peisun1115/subscriptions","organizations_url":"https://api.github.com/users/peisun1115/orgs","repos_url":"https://api.github.com/users/peisun1115/repos","events_url":"https://api.github.com/users/peisun1115/events{/privacy}","received_events_url":"https://api.github.com/users/peisun1115/received_events","type":"User","site_admin":false},"body":"done","created_at":"2016-09-26T21:26:48Z","updated_at":"2016-09-26T21:26:48Z","html_url":"https://github.com/Alluxio/alluxio/pull/3943#discussion_r80577291","pull_request_url":"https://api.github.com/repos/Alluxio/alluxio/pulls/3943","_links":{"self":{"href":"https://api.github.com/repos/Alluxio/alluxio/pulls/comments/80577291"},"html":{"href":"https://github.com/Alluxio/alluxio/pull/3943#discussion_r80577291"},"pull_request":{"href":"https://api.github.com/repos/Alluxio/alluxio/pulls/3943"}}},"pull_request":{"url":"https://api.github.com/repos/Alluxio/alluxio/pulls/3943","id":86785064,"html_url":"https://github.com/Alluxio/alluxio/pull/3943","diff_url":"https://github.com/Alluxio/alluxio/pull/3943.diff","patch_url":"https://github.com/Alluxio/alluxio/pull/3943.patch","issue_url":"https://api.github.com/repos/Alluxio/alluxio/issues/3943","number":3943,"state":"open","locked":false,"title":"[ALLUXIO-2236] Block worker thrift client pool","user":{"login":"peisun1115","id":18294241,"avatar_url":"https://avatars.githubusercontent.com/u/18294241?v=3","gravatar_id":"","url":"https://api.github.com/users/peisun1115","html_url":"https://github.com/peisun1115","followers_url":"https://api.github.com/users/peisun1115/followers","following_url":"https://api.github.com/users/peisun1115/following{/other_user}","gists_url":"https://api.github.com/users/peisun1115/gists{/gist_id}","starred_url":"https://api.github.com/users/peisun1115/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peisun1115/subscriptions","organizations_url":"https://api.github.com/users/peisun1115/orgs","repos_url":"https://api.github.com/users/peisun1115/repos","events_url":"https://api.github.com/users/peisun1115/events{/privacy}","received_events_url":"https://api.github.com/users/peisun1115/received_events","type":"User","site_admin":false},"body":"https://alluxio.atlassian.net/browse/ALLUXIO-2236\r\n\r\nThis addresses the following problems:\r\n1. Remove limit on the number of concurrent block worker clients each app can has by avoiding holding the connection all the time. So now we can do many concurrent file writes without deadlock. \r\n2. No short lived connections anymore.\r\n\r\nThis PR is diff-ed on https://github.com/Alluxio/alluxio/pull/3931\r\n","created_at":"2016-09-26T17:32:19Z","updated_at":"2016-09-26T21:26:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cbd8f9baaaa059988de7e8f8690b049f73c4ce8c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Alluxio/alluxio/pulls/3943/commits","review_comments_url":"https://api.github.com/repos/Alluxio/alluxio/pulls/3943/comments","review_comment_url":"https://api.github.com/repos/Alluxio/alluxio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Alluxio/alluxio/issues/3943/comments","statuses_url":"https://api.github.com/repos/Alluxio/alluxio/statuses/76870059f56290da72799789e063f30156195f83","head":{"label":"peisun1115:thrift","ref":"thrift","sha":"76870059f56290da72799789e063f30156195f83","user":{"login":"peisun1115","id":18294241,"avatar_url":"https://avatars.githubusercontent.com/u/18294241?v=3","gravatar_id":"","url":"https://api.github.com/users/peisun1115","html_url":"https://github.com/peisun1115","followers_url":"https://api.github.com/users/peisun1115/followers","following_url":"https://api.github.com/users/peisun1115/following{/other_user}","gists_url":"https://api.github.com/users/peisun1115/gists{/gist_id}","starred_url":"https://api.github.com/users/peisun1115/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peisun1115/subscriptions","organizations_url":"https://api.github.com/users/peisun1115/orgs","repos_url":"https://api.github.com/users/peisun1115/repos","events_url":"https://api.github.com/users/peisun1115/events{/privacy}","received_events_url":"https://api.github.com/users/peisun1115/received_events","type":"User","site_admin":false},"repo":{"id":55541423,"name":"alluxio","full_name":"peisun1115/alluxio","owner":{"login":"peisun1115","id":18294241,"avatar_url":"https://avatars.githubusercontent.com/u/18294241?v=3","gravatar_id":"","url":"https://api.github.com/users/peisun1115","html_url":"https://github.com/peisun1115","followers_url":"https://api.github.com/users/peisun1115/followers","following_url":"https://api.github.com/users/peisun1115/following{/other_user}","gists_url":"https://api.github.com/users/peisun1115/gists{/gist_id}","starred_url":"https://api.github.com/users/peisun1115/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peisun1115/subscriptions","organizations_url":"https://api.github.com/users/peisun1115/orgs","repos_url":"https://api.github.com/users/peisun1115/repos","events_url":"https://api.github.com/users/peisun1115/events{/privacy}","received_events_url":"https://api.github.com/users/peisun1115/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/peisun1115/alluxio","description":"Memory-Speed Virtual Distributed Storage System","fork":true,"url":"https://api.github.com/repos/peisun1115/alluxio","forks_url":"https://api.github.com/repos/peisun1115/alluxio/forks","keys_url":"https://api.github.com/repos/peisun1115/alluxio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/peisun1115/alluxio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/peisun1115/alluxio/teams","hooks_url":"https://api.github.com/repos/peisun1115/alluxio/hooks","issue_events_url":"https://api.github.com/repos/peisun1115/alluxio/issues/events{/number}","events_url":"https://api.github.com/repos/peisun1115/alluxio/events","assignees_url":"https://api.github.com/repos/peisun1115/alluxio/assignees{/user}","branches_url":"https://api.github.com/repos/peisun1115/alluxio/branches{/branch}","tags_url":"https://api.github.com/repos/peisun1115/alluxio/tags","blobs_url":"https://api.github.com/repos/peisun1115/alluxio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/peisun1115/alluxio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/peisun1115/alluxio/git/refs{/sha}","trees_url":"https://api.github.com/repos/peisun1115/alluxio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/peisun1115/alluxio/statuses/{sha}","languages_url":"https://api.github.com/repos/peisun1115/alluxio/languages","stargazers_url":"https://api.github.com/repos/peisun1115/alluxio/stargazers","contributors_url":"https://api.github.com/repos/peisun1115/alluxio/contributors","subscribers_url":"https://api.github.com/repos/peisun1115/alluxio/subscribers","subscription_url":"https://api.github.com/repos/peisun1115/alluxio/subscription","commits_url":"https://api.github.com/repos/peisun1115/alluxio/commits{/sha}","git_commits_url":"https://api.github.com/repos/peisun1115/alluxio/git/commits{/sha}","comments_url":"https://api.github.com/repos/peisun1115/alluxio/comments{/number}","issue_comment_url":"https://api.github.com/repos/peisun1115/alluxio/issues/comments{/number}","contents_url":"https://api.github.com/repos/peisun1115/alluxio/contents/{+path}","compare_url":"https://api.github.com/repos/peisun1115/alluxio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/peisun1115/alluxio/merges","archive_url":"https://api.github.com/repos/peisun1115/alluxio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/peisun1115/alluxio/downloads","issues_url":"https://api.github.com/repos/peisun1115/alluxio/issues{/number}","pulls_url":"https://api.github.com/repos/peisun1115/alluxio/pulls{/number}","milestones_url":"https://api.github.com/repos/peisun1115/alluxio/milestones{/number}","notifications_url":"https://api.github.com/repos/peisun1115/alluxio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/peisun1115/alluxio/labels{/name}","releases_url":"https://api.github.com/repos/peisun1115/alluxio/releases{/id}","deployments_url":"https://api.github.com/repos/peisun1115/alluxio/deployments","created_at":"2016-04-05T20:01:18Z","updated_at":"2016-04-05T20:01:22Z","pushed_at":"2016-09-26T20:20:50Z","git_url":"git://github.com/peisun1115/alluxio.git","ssh_url":"git@github.com:peisun1115/alluxio.git","clone_url":"https://github.com/peisun1115/alluxio.git","svn_url":"https://github.com/peisun1115/alluxio","homepage":"http://www.alluxio.org/","size":60477,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Alluxio:master","ref":"master","sha":"2f631f6a119959576f22beb769c4b60dc5d6317e","user":{"login":"Alluxio","id":16203694,"avatar_url":"https://avatars.githubusercontent.com/u/16203694?v=3","gravatar_id":"","url":"https://api.github.com/users/Alluxio","html_url":"https://github.com/Alluxio","followers_url":"https://api.github.com/users/Alluxio/followers","following_url":"https://api.github.com/users/Alluxio/following{/other_user}","gists_url":"https://api.github.com/users/Alluxio/gists{/gist_id}","starred_url":"https://api.github.com/users/Alluxio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alluxio/subscriptions","organizations_url":"https://api.github.com/users/Alluxio/orgs","repos_url":"https://api.github.com/users/Alluxio/repos","events_url":"https://api.github.com/users/Alluxio/events{/privacy}","received_events_url":"https://api.github.com/users/Alluxio/received_events","type":"Organization","site_admin":false},"repo":{"id":7276954,"name":"alluxio","full_name":"Alluxio/alluxio","owner":{"login":"Alluxio","id":16203694,"avatar_url":"https://avatars.githubusercontent.com/u/16203694?v=3","gravatar_id":"","url":"https://api.github.com/users/Alluxio","html_url":"https://github.com/Alluxio","followers_url":"https://api.github.com/users/Alluxio/followers","following_url":"https://api.github.com/users/Alluxio/following{/other_user}","gists_url":"https://api.github.com/users/Alluxio/gists{/gist_id}","starred_url":"https://api.github.com/users/Alluxio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alluxio/subscriptions","organizations_url":"https://api.github.com/users/Alluxio/orgs","repos_url":"https://api.github.com/users/Alluxio/repos","events_url":"https://api.github.com/users/Alluxio/events{/privacy}","received_events_url":"https://api.github.com/users/Alluxio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Alluxio/alluxio","description":"Alluxio, formerly Tachyon, Memory Speed Virtual Distributed Storage System","fork":false,"url":"https://api.github.com/repos/Alluxio/alluxio","forks_url":"https://api.github.com/repos/Alluxio/alluxio/forks","keys_url":"https://api.github.com/repos/Alluxio/alluxio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Alluxio/alluxio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Alluxio/alluxio/teams","hooks_url":"https://api.github.com/repos/Alluxio/alluxio/hooks","issue_events_url":"https://api.github.com/repos/Alluxio/alluxio/issues/events{/number}","events_url":"https://api.github.com/repos/Alluxio/alluxio/events","assignees_url":"https://api.github.com/repos/Alluxio/alluxio/assignees{/user}","branches_url":"https://api.github.com/repos/Alluxio/alluxio/branches{/branch}","tags_url":"https://api.github.com/repos/Alluxio/alluxio/tags","blobs_url":"https://api.github.com/repos/Alluxio/alluxio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Alluxio/alluxio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Alluxio/alluxio/git/refs{/sha}","trees_url":"https://api.github.com/repos/Alluxio/alluxio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Alluxio/alluxio/statuses/{sha}","languages_url":"https://api.github.com/repos/Alluxio/alluxio/languages","stargazers_url":"https://api.github.com/repos/Alluxio/alluxio/stargazers","contributors_url":"https://api.github.com/repos/Alluxio/alluxio/contributors","subscribers_url":"https://api.github.com/repos/Alluxio/alluxio/subscribers","subscription_url":"https://api.github.com/repos/Alluxio/alluxio/subscription","commits_url":"https://api.github.com/repos/Alluxio/alluxio/commits{/sha}","git_commits_url":"https://api.github.com/repos/Alluxio/alluxio/git/commits{/sha}","comments_url":"https://api.github.com/repos/Alluxio/alluxio/comments{/number}","issue_comment_url":"https://api.github.com/repos/Alluxio/alluxio/issues/comments{/number}","contents_url":"https://api.github.com/repos/Alluxio/alluxio/contents/{+path}","compare_url":"https://api.github.com/repos/Alluxio/alluxio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Alluxio/alluxio/merges","archive_url":"https://api.github.com/repos/Alluxio/alluxio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Alluxio/alluxio/downloads","issues_url":"https://api.github.com/repos/Alluxio/alluxio/issues{/number}","pulls_url":"https://api.github.com/repos/Alluxio/alluxio/pulls{/number}","milestones_url":"https://api.github.com/repos/Alluxio/alluxio/milestones{/number}","notifications_url":"https://api.github.com/repos/Alluxio/alluxio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Alluxio/alluxio/labels{/name}","releases_url":"https://api.github.com/repos/Alluxio/alluxio/releases{/id}","deployments_url":"https://api.github.com/repos/Alluxio/alluxio/deployments","created_at":"2012-12-21T17:43:46Z","updated_at":"2016-09-26T20:41:47Z","pushed_at":"2016-09-26T20:20:50Z","git_url":"git://github.com/Alluxio/alluxio.git","ssh_url":"git@github.com:Alluxio/alluxio.git","clone_url":"https://github.com/Alluxio/alluxio.git","svn_url":"https://github.com/Alluxio/alluxio","homepage":"http://www.alluxio.org/","size":93352,"stargazers_count":2615,"watchers_count":2615,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1076,"mirror_url":null,"open_issues_count":12,"forks":1076,"open_issues":12,"watchers":2615,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Alluxio/alluxio/pulls/3943"},"html":{"href":"https://github.com/Alluxio/alluxio/pull/3943"},"issue":{"href":"https://api.github.com/repos/Alluxio/alluxio/issues/3943"},"comments":{"href":"https://api.github.com/repos/Alluxio/alluxio/issues/3943/comments"},"review_comments":{"href":"https://api.github.com/repos/Alluxio/alluxio/pulls/3943/comments"},"review_comment":{"href":"https://api.github.com/repos/Alluxio/alluxio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Alluxio/alluxio/pulls/3943/commits"},"statuses":{"href":"https://api.github.com/repos/Alluxio/alluxio/statuses/76870059f56290da72799789e063f30156195f83"}}}}
{"actor":{"display_login":"peisun1115"}}