{"action":"created","comment":{"url":"https://api.github.com/repos/prestodb/presto/pulls/comments/77945288","id":77945288,"diff_hunk":"@@ -87,68 +90,101 @@ public void addSystemSessionProperties(List<PropertyMetadata<?>> systemSessionPr\n     public void addSystemSessionProperty(PropertyMetadata<?> sessionProperty)\n     {\n         requireNonNull(sessionProperty, \"sessionProperty is null\");\n-        addSessionPropertyInternal(Optional.empty(), sessionProperty);\n+        SessionPropertyMetadata<?> value = new SessionPropertyMetadata<>(Optional.empty(), Optional.empty(), sessionProperty);\n+        allSessionProperties.put(value.getFullyQualifiedName(), value);\n     }\n \n-    public void addConnectorSessionProperties(String catalog, List<PropertyMetadata<?>> sessionProperties)\n+    public void addConnectorSessionProperties(String catalog, ConnectorId connectorId, List<PropertyMetadata<?>> sessionProperties)\n     {\n         requireNonNull(catalog, \"catalog is null\");\n         checkArgument(!catalog.isEmpty() && catalog.trim().toLowerCase(ENGLISH).equals(catalog), \"Invalid catalog name '%s'\", catalog);\n+        requireNonNull(connectorId, \"connectorId is null\");\n         requireNonNull(sessionProperties, \"sessionProperties is null\");\n \n-        checkState(catalogSessionProperties.putIfAbsent(catalog, sessionProperties) == null, \"SessionProperties for catalog '%s' are already registered\", catalog);\n-        for (PropertyMetadata<?> sessionProperty : sessionProperties) {\n-            addSessionPropertyInternal(Optional.of(catalog), sessionProperty);\n+        List<SessionPropertyMetadata<?>> properties = sessionProperties.stream()\n+                .map(sessionProperty -> new SessionPropertyMetadata<>(Optional.of(catalog), Optional.of(connectorId), sessionProperty))\n+                .collect(toList());\n+\n+        Map<String, SessionPropertyMetadata<?>> propertiesByName = Maps.uniqueIndex(properties, SessionPropertyMetadata::getPropertyName);\n+        checkState(connectorSessionProperties.putIfAbsent(connectorId, propertiesByName) == null, \"SessionProperties for connectorId '%s' are already registered\", connectorId);\n+\n+        for (SessionPropertyMetadata<?> property : properties) {\n+            allSessionProperties.put(property.getFullyQualifiedName(), property);\n         }\n     }\n \n-    private <T> void addSessionPropertyInternal(Optional<String> catalogName, PropertyMetadata<T> sessionProperty)\n+    public Optional<ConnectorId> getSessionPropertyConnectorId(String name)","path":"presto-main/src/main/java/com/facebook/presto/metadata/SessionPropertyManager.java","position":65,"original_position":65,"commit_id":"60ea21b2e36f1f88095c7d265f190782aaff8bb7","original_commit_id":"60ea21b2e36f1f88095c7d265f190782aaff8bb7","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":"This method can be\r\n```java\r\nreturn getSessionPropertyMetadata(name).getConnectorId();","created_at":"2016-09-08T04:44:50Z","updated_at":"2016-09-08T04:44:50Z","html_url":"https://github.com/prestodb/presto/pull/6044#discussion_r77945288","pull_request_url":"https://api.github.com/repos/prestodb/presto/pulls/6044","_links":{"self":{"href":"https://api.github.com/repos/prestodb/presto/pulls/comments/77945288"},"html":{"href":"https://github.com/prestodb/presto/pull/6044#discussion_r77945288"},"pull_request":{"href":"https://api.github.com/repos/prestodb/presto/pulls/6044"}}},"pull_request":{"url":"https://api.github.com/repos/prestodb/presto/pulls/6044","id":84070407,"html_url":"https://github.com/prestodb/presto/pull/6044","diff_url":"https://github.com/prestodb/presto/pull/6044.diff","patch_url":"https://github.com/prestodb/presto/pull/6044.patch","issue_url":"https://api.github.com/repos/prestodb/presto/issues/6044","number":6044,"state":"open","locked":false,"title":"Add ConnectorId to enforce separation from catalog name","user":{"login":"dain","id":58298,"avatar_url":"https://avatars.githubusercontent.com/u/58298?v=3","gravatar_id":"","url":"https://api.github.com/users/dain","html_url":"https://github.com/dain","followers_url":"https://api.github.com/users/dain/followers","following_url":"https://api.github.com/users/dain/following{/other_user}","gists_url":"https://api.github.com/users/dain/gists{/gist_id}","starred_url":"https://api.github.com/users/dain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dain/subscriptions","organizations_url":"https://api.github.com/users/dain/orgs","repos_url":"https://api.github.com/users/dain/repos","events_url":"https://api.github.com/users/dain/events{/privacy}","received_events_url":"https://api.github.com/users/dain/received_events","type":"User","site_admin":false},"body":null,"created_at":"2016-09-06T07:06:00Z","updated_at":"2016-09-08T04:44:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"13756acebb486482241b7114b7a48c04d4707efd","assignee":{"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},"assignees":[{"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}],"milestone":null,"commits_url":"https://api.github.com/repos/prestodb/presto/pulls/6044/commits","review_comments_url":"https://api.github.com/repos/prestodb/presto/pulls/6044/comments","review_comment_url":"https://api.github.com/repos/prestodb/presto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prestodb/presto/issues/6044/comments","statuses_url":"https://api.github.com/repos/prestodb/presto/statuses/60ea21b2e36f1f88095c7d265f190782aaff8bb7","head":{"label":"dain:connector-id","ref":"connector-id","sha":"60ea21b2e36f1f88095c7d265f190782aaff8bb7","user":{"login":"dain","id":58298,"avatar_url":"https://avatars.githubusercontent.com/u/58298?v=3","gravatar_id":"","url":"https://api.github.com/users/dain","html_url":"https://github.com/dain","followers_url":"https://api.github.com/users/dain/followers","following_url":"https://api.github.com/users/dain/following{/other_user}","gists_url":"https://api.github.com/users/dain/gists{/gist_id}","starred_url":"https://api.github.com/users/dain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dain/subscriptions","organizations_url":"https://api.github.com/users/dain/orgs","repos_url":"https://api.github.com/users/dain/repos","events_url":"https://api.github.com/users/dain/events{/privacy}","received_events_url":"https://api.github.com/users/dain/received_events","type":"User","site_admin":false},"repo":{"id":5403482,"name":"presto","full_name":"dain/presto","owner":{"login":"dain","id":58298,"avatar_url":"https://avatars.githubusercontent.com/u/58298?v=3","gravatar_id":"","url":"https://api.github.com/users/dain","html_url":"https://github.com/dain","followers_url":"https://api.github.com/users/dain/followers","following_url":"https://api.github.com/users/dain/following{/other_user}","gists_url":"https://api.github.com/users/dain/gists{/gist_id}","starred_url":"https://api.github.com/users/dain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dain/subscriptions","organizations_url":"https://api.github.com/users/dain/orgs","repos_url":"https://api.github.com/users/dain/repos","events_url":"https://api.github.com/users/dain/events{/privacy}","received_events_url":"https://api.github.com/users/dain/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dain/presto","description":"Distributed SQL query engine for big data","fork":true,"url":"https://api.github.com/repos/dain/presto","forks_url":"https://api.github.com/repos/dain/presto/forks","keys_url":"https://api.github.com/repos/dain/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dain/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dain/presto/teams","hooks_url":"https://api.github.com/repos/dain/presto/hooks","issue_events_url":"https://api.github.com/repos/dain/presto/issues/events{/number}","events_url":"https://api.github.com/repos/dain/presto/events","assignees_url":"https://api.github.com/repos/dain/presto/assignees{/user}","branches_url":"https://api.github.com/repos/dain/presto/branches{/branch}","tags_url":"https://api.github.com/repos/dain/presto/tags","blobs_url":"https://api.github.com/repos/dain/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dain/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dain/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/dain/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dain/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/dain/presto/languages","stargazers_url":"https://api.github.com/repos/dain/presto/stargazers","contributors_url":"https://api.github.com/repos/dain/presto/contributors","subscribers_url":"https://api.github.com/repos/dain/presto/subscribers","subscription_url":"https://api.github.com/repos/dain/presto/subscription","commits_url":"https://api.github.com/repos/dain/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/dain/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/dain/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/dain/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/dain/presto/contents/{+path}","compare_url":"https://api.github.com/repos/dain/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dain/presto/merges","archive_url":"https://api.github.com/repos/dain/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dain/presto/downloads","issues_url":"https://api.github.com/repos/dain/presto/issues{/number}","pulls_url":"https://api.github.com/repos/dain/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/dain/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/dain/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dain/presto/labels{/name}","releases_url":"https://api.github.com/repos/dain/presto/releases{/id}","deployments_url":"https://api.github.com/repos/dain/presto/deployments","created_at":"2012-08-13T19:14:12Z","updated_at":"2015-06-24T10:03:33Z","pushed_at":"2016-09-07T00:17:22Z","git_url":"git://github.com/dain/presto.git","ssh_url":"git@github.com:dain/presto.git","clone_url":"https://github.com/dain/presto.git","svn_url":"https://github.com/dain/presto","homepage":"http://prestodb.io/","size":59127,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"prestodb:master","ref":"master","sha":"09e77a43d28b3bb8686cffb50b3a45bb5ea50e82","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-09-08T02:41:30Z","pushed_at":"2016-09-08T02:56:17Z","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":162298,"stargazers_count":5092,"watchers_count":5092,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1565,"mirror_url":null,"open_issues_count":652,"forks":1565,"open_issues":652,"watchers":5092,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prestodb/presto/pulls/6044"},"html":{"href":"https://github.com/prestodb/presto/pull/6044"},"issue":{"href":"https://api.github.com/repos/prestodb/presto/issues/6044"},"comments":{"href":"https://api.github.com/repos/prestodb/presto/issues/6044/comments"},"review_comments":{"href":"https://api.github.com/repos/prestodb/presto/pulls/6044/comments"},"review_comment":{"href":"https://api.github.com/repos/prestodb/presto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prestodb/presto/pulls/6044/commits"},"statuses":{"href":"https://api.github.com/repos/prestodb/presto/statuses/60ea21b2e36f1f88095c7d265f190782aaff8bb7"}}}}
{"actor":{"display_login":"electrum"}}