{"action":"created","comment":{"url":"https://api.github.com/repos/prestodb/presto/pulls/comments/88527374","pull_request_review_id":9099191,"id":88527374,"diff_hunk":"@@ -81,6 +117,62 @@ public void configure(ResourceGroup group, SelectionContext context)\n     @Override\n     public List<ResourceGroupSelector> getSelectors()\n     {\n-        return selectors;\n+        return selectors.get();\n+    }\n+\n+    @Override\n+    public void addConfigReloadListener(Consumer<Void> listener)\n+    {\n+        listeners.add(requireNonNull(listener, \"listener is null\"));\n+    }\n+\n+    @PostConstruct\n+    public void start()\n+    {\n+        executor.execute(() -> {\n+            while (true) {\n+                WatchKey key = null;\n+                try {\n+                    key = watchService.take();\n+                    for (WatchEvent<?> event : key.pollEvents()) {\n+                        Path changed = (Path) event.context();\n+                        if (changed.equals(configFile.getFileName())) {\n+                            log.info(\"Reloading %s\", configFile);\n+                            configure();\n+                            invalidateMemoryPoolFraction();\n+                            listeners.stream().forEach(listener -> listener.accept(null));\n+                        }\n+                    }\n+                }\n+                catch (InterruptedException e) {\n+                    Thread.currentThread().interrupt();\n+                    Throwables.propagate(e);\n+                }\n+                catch (Throwable t) {\n+                    log.warn(\"Exception while reloading changes: %s\", t.getMessage());\n+                }\n+                finally {\n+                    if (key != null) {\n+                        if (!key.reset()) {","path":"presto-resource-group-managers/src/main/java/com/facebook/presto/resourceGroups/FileResourceGroupConfigurationManager.java","position":150,"original_position":150,"commit_id":"d9bbbd9d9cb9bbaaefac696921364727bf216783","original_commit_id":"d9bbbd9d9cb9bbaaefac696921364727bf216783","user":{"login":"electrum","id":9230,"avatar_url":"https://avatars.githubusercontent.com/u/9230?v=3","gravatar_id":"","url":"https://api.github.com/users/electrum","html_url":"https://github.com/electrum","followers_url":"https://api.github.com/users/electrum/followers","following_url":"https://api.github.com/users/electrum/following{/other_user}","gists_url":"https://api.github.com/users/electrum/gists{/gist_id}","starred_url":"https://api.github.com/users/electrum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electrum/subscriptions","organizations_url":"https://api.github.com/users/electrum/orgs","repos_url":"https://api.github.com/users/electrum/repos","events_url":"https://api.github.com/users/electrum/events{/privacy}","received_events_url":"https://api.github.com/users/electrum/received_events","type":"User","site_admin":false},"body":"Why would this occur? Is it a bug?","created_at":"2016-11-17T19:27:39Z","updated_at":"2016-11-17T19:27:39Z","html_url":"https://github.com/prestodb/presto/pull/6483#discussion_r88527374","pull_request_url":"https://api.github.com/repos/prestodb/presto/pulls/6483","_links":{"self":{"href":"https://api.github.com/repos/prestodb/presto/pulls/comments/88527374"},"html":{"href":"https://github.com/prestodb/presto/pull/6483#discussion_r88527374"},"pull_request":{"href":"https://api.github.com/repos/prestodb/presto/pulls/6483"}}},"pull_request":{"url":"https://api.github.com/repos/prestodb/presto/pulls/6483","id":91657378,"html_url":"https://github.com/prestodb/presto/pull/6483","diff_url":"https://github.com/prestodb/presto/pull/6483.diff","patch_url":"https://github.com/prestodb/presto/pull/6483.patch","issue_url":"https://api.github.com/repos/prestodb/presto/issues/6483","number":6483,"state":"open","locked":false,"title":"Add support for reloadable FileResourceGroupConfigurationManager","user":{"login":"nezihyigitbasi","id":1223839,"avatar_url":"https://avatars.githubusercontent.com/u/1223839?v=3","gravatar_id":"","url":"https://api.github.com/users/nezihyigitbasi","html_url":"https://github.com/nezihyigitbasi","followers_url":"https://api.github.com/users/nezihyigitbasi/followers","following_url":"https://api.github.com/users/nezihyigitbasi/following{/other_user}","gists_url":"https://api.github.com/users/nezihyigitbasi/gists{/gist_id}","starred_url":"https://api.github.com/users/nezihyigitbasi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nezihyigitbasi/subscriptions","organizations_url":"https://api.github.com/users/nezihyigitbasi/orgs","repos_url":"https://api.github.com/users/nezihyigitbasi/repos","events_url":"https://api.github.com/users/nezihyigitbasi/events{/privacy}","received_events_url":"https://api.github.com/users/nezihyigitbasi/received_events","type":"User","site_admin":false},"body":"This PR adds:\r\n- a read only rest endpoint for resource groups\r\n- reload support for `FileResourceGroupConfigurationManager`","created_at":"2016-10-31T17:53:01Z","updated_at":"2016-11-17T19:27:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"abc458a19a2afbce12385e78bef8da8ee23e1555","assignee":{"login":"cberner","id":842688,"avatar_url":"https://avatars.githubusercontent.com/u/842688?v=3","gravatar_id":"","url":"https://api.github.com/users/cberner","html_url":"https://github.com/cberner","followers_url":"https://api.github.com/users/cberner/followers","following_url":"https://api.github.com/users/cberner/following{/other_user}","gists_url":"https://api.github.com/users/cberner/gists{/gist_id}","starred_url":"https://api.github.com/users/cberner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cberner/subscriptions","organizations_url":"https://api.github.com/users/cberner/orgs","repos_url":"https://api.github.com/users/cberner/repos","events_url":"https://api.github.com/users/cberner/events{/privacy}","received_events_url":"https://api.github.com/users/cberner/received_events","type":"User","site_admin":false},"assignees":[{"login":"cberner","id":842688,"avatar_url":"https://avatars.githubusercontent.com/u/842688?v=3","gravatar_id":"","url":"https://api.github.com/users/cberner","html_url":"https://github.com/cberner","followers_url":"https://api.github.com/users/cberner/followers","following_url":"https://api.github.com/users/cberner/following{/other_user}","gists_url":"https://api.github.com/users/cberner/gists{/gist_id}","starred_url":"https://api.github.com/users/cberner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cberner/subscriptions","organizations_url":"https://api.github.com/users/cberner/orgs","repos_url":"https://api.github.com/users/cberner/repos","events_url":"https://api.github.com/users/cberner/events{/privacy}","received_events_url":"https://api.github.com/users/cberner/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/prestodb/presto/pulls/6483/commits","review_comments_url":"https://api.github.com/repos/prestodb/presto/pulls/6483/comments","review_comment_url":"https://api.github.com/repos/prestodb/presto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prestodb/presto/issues/6483/comments","statuses_url":"https://api.github.com/repos/prestodb/presto/statuses/d9bbbd9d9cb9bbaaefac696921364727bf216783","head":{"label":"nezihyigitbasi:reload-res-config-v2","ref":"reload-res-config-v2","sha":"d9bbbd9d9cb9bbaaefac696921364727bf216783","user":{"login":"nezihyigitbasi","id":1223839,"avatar_url":"https://avatars.githubusercontent.com/u/1223839?v=3","gravatar_id":"","url":"https://api.github.com/users/nezihyigitbasi","html_url":"https://github.com/nezihyigitbasi","followers_url":"https://api.github.com/users/nezihyigitbasi/followers","following_url":"https://api.github.com/users/nezihyigitbasi/following{/other_user}","gists_url":"https://api.github.com/users/nezihyigitbasi/gists{/gist_id}","starred_url":"https://api.github.com/users/nezihyigitbasi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nezihyigitbasi/subscriptions","organizations_url":"https://api.github.com/users/nezihyigitbasi/orgs","repos_url":"https://api.github.com/users/nezihyigitbasi/repos","events_url":"https://api.github.com/users/nezihyigitbasi/events{/privacy}","received_events_url":"https://api.github.com/users/nezihyigitbasi/received_events","type":"User","site_admin":false},"repo":{"id":20698188,"name":"presto","full_name":"nezihyigitbasi/presto","owner":{"login":"nezihyigitbasi","id":1223839,"avatar_url":"https://avatars.githubusercontent.com/u/1223839?v=3","gravatar_id":"","url":"https://api.github.com/users/nezihyigitbasi","html_url":"https://github.com/nezihyigitbasi","followers_url":"https://api.github.com/users/nezihyigitbasi/followers","following_url":"https://api.github.com/users/nezihyigitbasi/following{/other_user}","gists_url":"https://api.github.com/users/nezihyigitbasi/gists{/gist_id}","starred_url":"https://api.github.com/users/nezihyigitbasi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nezihyigitbasi/subscriptions","organizations_url":"https://api.github.com/users/nezihyigitbasi/orgs","repos_url":"https://api.github.com/users/nezihyigitbasi/repos","events_url":"https://api.github.com/users/nezihyigitbasi/events{/privacy}","received_events_url":"https://api.github.com/users/nezihyigitbasi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nezihyigitbasi/presto","description":"Distributed SQL query engine for big data","fork":true,"url":"https://api.github.com/repos/nezihyigitbasi/presto","forks_url":"https://api.github.com/repos/nezihyigitbasi/presto/forks","keys_url":"https://api.github.com/repos/nezihyigitbasi/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nezihyigitbasi/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nezihyigitbasi/presto/teams","hooks_url":"https://api.github.com/repos/nezihyigitbasi/presto/hooks","issue_events_url":"https://api.github.com/repos/nezihyigitbasi/presto/issues/events{/number}","events_url":"https://api.github.com/repos/nezihyigitbasi/presto/events","assignees_url":"https://api.github.com/repos/nezihyigitbasi/presto/assignees{/user}","branches_url":"https://api.github.com/repos/nezihyigitbasi/presto/branches{/branch}","tags_url":"https://api.github.com/repos/nezihyigitbasi/presto/tags","blobs_url":"https://api.github.com/repos/nezihyigitbasi/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nezihyigitbasi/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nezihyigitbasi/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/nezihyigitbasi/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nezihyigitbasi/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/nezihyigitbasi/presto/languages","stargazers_url":"https://api.github.com/repos/nezihyigitbasi/presto/stargazers","contributors_url":"https://api.github.com/repos/nezihyigitbasi/presto/contributors","subscribers_url":"https://api.github.com/repos/nezihyigitbasi/presto/subscribers","subscription_url":"https://api.github.com/repos/nezihyigitbasi/presto/subscription","commits_url":"https://api.github.com/repos/nezihyigitbasi/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/nezihyigitbasi/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/nezihyigitbasi/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/nezihyigitbasi/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/nezihyigitbasi/presto/contents/{+path}","compare_url":"https://api.github.com/repos/nezihyigitbasi/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nezihyigitbasi/presto/merges","archive_url":"https://api.github.com/repos/nezihyigitbasi/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nezihyigitbasi/presto/downloads","issues_url":"https://api.github.com/repos/nezihyigitbasi/presto/issues{/number}","pulls_url":"https://api.github.com/repos/nezihyigitbasi/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/nezihyigitbasi/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/nezihyigitbasi/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nezihyigitbasi/presto/labels{/name}","releases_url":"https://api.github.com/repos/nezihyigitbasi/presto/releases{/id}","deployments_url":"https://api.github.com/repos/nezihyigitbasi/presto/deployments","created_at":"2014-06-10T19:14:21Z","updated_at":"2016-10-26T19:59:21Z","pushed_at":"2016-11-17T17:53:50Z","git_url":"git://github.com/nezihyigitbasi/presto.git","ssh_url":"git@github.com:nezihyigitbasi/presto.git","clone_url":"https://github.com/nezihyigitbasi/presto.git","svn_url":"https://github.com/nezihyigitbasi/presto","homepage":"http://prestodb.io/","size":63980,"stargazers_count":1,"watchers_count":1,"language":"Java","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":1,"default_branch":"master"}},"base":{"label":"prestodb:master","ref":"master","sha":"3a55691bc91166914949eb010f82892cf8e1a1a2","user":{"login":"prestodb","id":6882181,"avatar_url":"https://avatars.githubusercontent.com/u/6882181?v=3","gravatar_id":"","url":"https://api.github.com/users/prestodb","html_url":"https://github.com/prestodb","followers_url":"https://api.github.com/users/prestodb/followers","following_url":"https://api.github.com/users/prestodb/following{/other_user}","gists_url":"https://api.github.com/users/prestodb/gists{/gist_id}","starred_url":"https://api.github.com/users/prestodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestodb/subscriptions","organizations_url":"https://api.github.com/users/prestodb/orgs","repos_url":"https://api.github.com/users/prestodb/repos","events_url":"https://api.github.com/users/prestodb/events{/privacy}","received_events_url":"https://api.github.com/users/prestodb/received_events","type":"Organization","site_admin":false},"repo":{"id":5349565,"name":"presto","full_name":"prestodb/presto","owner":{"login":"prestodb","id":6882181,"avatar_url":"https://avatars.githubusercontent.com/u/6882181?v=3","gravatar_id":"","url":"https://api.github.com/users/prestodb","html_url":"https://github.com/prestodb","followers_url":"https://api.github.com/users/prestodb/followers","following_url":"https://api.github.com/users/prestodb/following{/other_user}","gists_url":"https://api.github.com/users/prestodb/gists{/gist_id}","starred_url":"https://api.github.com/users/prestodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestodb/subscriptions","organizations_url":"https://api.github.com/users/prestodb/orgs","repos_url":"https://api.github.com/users/prestodb/repos","events_url":"https://api.github.com/users/prestodb/events{/privacy}","received_events_url":"https://api.github.com/users/prestodb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prestodb/presto","description":"Distributed SQL query engine for big data","fork":false,"url":"https://api.github.com/repos/prestodb/presto","forks_url":"https://api.github.com/repos/prestodb/presto/forks","keys_url":"https://api.github.com/repos/prestodb/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prestodb/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prestodb/presto/teams","hooks_url":"https://api.github.com/repos/prestodb/presto/hooks","issue_events_url":"https://api.github.com/repos/prestodb/presto/issues/events{/number}","events_url":"https://api.github.com/repos/prestodb/presto/events","assignees_url":"https://api.github.com/repos/prestodb/presto/assignees{/user}","branches_url":"https://api.github.com/repos/prestodb/presto/branches{/branch}","tags_url":"https://api.github.com/repos/prestodb/presto/tags","blobs_url":"https://api.github.com/repos/prestodb/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prestodb/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prestodb/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/prestodb/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prestodb/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/prestodb/presto/languages","stargazers_url":"https://api.github.com/repos/prestodb/presto/stargazers","contributors_url":"https://api.github.com/repos/prestodb/presto/contributors","subscribers_url":"https://api.github.com/repos/prestodb/presto/subscribers","subscription_url":"https://api.github.com/repos/prestodb/presto/subscription","commits_url":"https://api.github.com/repos/prestodb/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/prestodb/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/prestodb/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/prestodb/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/prestodb/presto/contents/{+path}","compare_url":"https://api.github.com/repos/prestodb/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prestodb/presto/merges","archive_url":"https://api.github.com/repos/prestodb/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prestodb/presto/downloads","issues_url":"https://api.github.com/repos/prestodb/presto/issues{/number}","pulls_url":"https://api.github.com/repos/prestodb/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/prestodb/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/prestodb/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prestodb/presto/labels{/name}","releases_url":"https://api.github.com/repos/prestodb/presto/releases{/id}","deployments_url":"https://api.github.com/repos/prestodb/presto/deployments","created_at":"2012-08-09T01:03:37Z","updated_at":"2016-11-17T17:09:48Z","pushed_at":"2016-11-17T19:20:47Z","git_url":"git://github.com/prestodb/presto.git","ssh_url":"git@github.com:prestodb/presto.git","clone_url":"https://github.com/prestodb/presto.git","svn_url":"https://github.com/prestodb/presto","homepage":"https://prestodb.io","size":172375,"stargazers_count":5296,"watchers_count":5296,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1654,"mirror_url":null,"open_issues_count":734,"forks":1654,"open_issues":734,"watchers":5296,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prestodb/presto/pulls/6483"},"html":{"href":"https://github.com/prestodb/presto/pull/6483"},"issue":{"href":"https://api.github.com/repos/prestodb/presto/issues/6483"},"comments":{"href":"https://api.github.com/repos/prestodb/presto/issues/6483/comments"},"review_comments":{"href":"https://api.github.com/repos/prestodb/presto/pulls/6483/comments"},"review_comment":{"href":"https://api.github.com/repos/prestodb/presto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prestodb/presto/pulls/6483/commits"},"statuses":{"href":"https://api.github.com/repos/prestodb/presto/statuses/d9bbbd9d9cb9bbaaefac696921364727bf216783"}}}}
{"actor":{"display_login":"electrum"}}