{"action":"created","comment":{"url":"https://api.github.com/repos/datastax/java-driver/pulls/comments/93686216","pull_request_review_id":14219516,"id":93686216,"diff_hunk":"@@ -321,8 +323,25 @@ public static boolean isReservedCqlKeyword(String id) {\n         if (current == null) {\n             return Collections.emptySet();\n         } else {\n-            Set<Host> hosts = current.getReplicas(keyspace, range.getEnd());\n-            return hosts == null ? Collections.<Host>emptySet() : hosts;\n+            Set<Host> replicas = Sets.newHashSet();\n+            Set<Host> allHosts = getAllHosts();\n+            // for each host's range, if it intersects with the input range, include that range's replicas.\n+            // this is a bit repetitive as we may evaluate the same ranges multiple times.","path":"driver-core/src/main/java/com/datastax/driver/core/Metadata.java","position":27,"original_position":27,"commit_id":"118895aa46a208c95621ad82a4a5ded781013499","original_commit_id":"118895aa46a208c95621ad82a4a5ded781013499","user":{"login":"tolbertam","id":6889771,"avatar_url":"https://avatars.githubusercontent.com/u/6889771?v=3","gravatar_id":"","url":"https://api.github.com/users/tolbertam","html_url":"https://github.com/tolbertam","followers_url":"https://api.github.com/users/tolbertam/followers","following_url":"https://api.github.com/users/tolbertam/following{/other_user}","gists_url":"https://api.github.com/users/tolbertam/gists{/gist_id}","starred_url":"https://api.github.com/users/tolbertam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tolbertam/subscriptions","organizations_url":"https://api.github.com/users/tolbertam/orgs","repos_url":"https://api.github.com/users/tolbertam/repos","events_url":"https://api.github.com/users/tolbertam/events{/privacy}","received_events_url":"https://api.github.com/users/tolbertam/received_events","type":"User","site_admin":false},"body":"As documented, this is not ideal since we could evaluate the same range multiple times, but couldn't find a direct way to get at a host's primary ranges.","created_at":"2016-12-22T19:50:55Z","updated_at":"2016-12-22T19:50:55Z","html_url":"https://github.com/datastax/java-driver/pull/777#discussion_r93686216","pull_request_url":"https://api.github.com/repos/datastax/java-driver/pulls/777","_links":{"self":{"href":"https://api.github.com/repos/datastax/java-driver/pulls/comments/93686216"},"html":{"href":"https://github.com/datastax/java-driver/pull/777#discussion_r93686216"},"pull_request":{"href":"https://api.github.com/repos/datastax/java-driver/pulls/777"}}},"pull_request":{"url":"https://api.github.com/repos/datastax/java-driver/pulls/777","id":99160292,"html_url":"https://github.com/datastax/java-driver/pull/777","diff_url":"https://github.com/datastax/java-driver/pull/777.diff","patch_url":"https://github.com/datastax/java-driver/pull/777.patch","issue_url":"https://api.github.com/repos/datastax/java-driver/issues/777","number":777,"state":"open","locked":false,"title":"JAVA-1355: Update getReplicas to handle range covering multiple hosts","user":{"login":"tolbertam","id":6889771,"avatar_url":"https://avatars.githubusercontent.com/u/6889771?v=3","gravatar_id":"","url":"https://api.github.com/users/tolbertam","html_url":"https://github.com/tolbertam","followers_url":"https://api.github.com/users/tolbertam/followers","following_url":"https://api.github.com/users/tolbertam/following{/other_user}","gists_url":"https://api.github.com/users/tolbertam/gists{/gist_id}","starred_url":"https://api.github.com/users/tolbertam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tolbertam/subscriptions","organizations_url":"https://api.github.com/users/tolbertam/orgs","repos_url":"https://api.github.com/users/tolbertam/repos","events_url":"https://api.github.com/users/tolbertam/events{/privacy}","received_events_url":"https://api.github.com/users/tolbertam/received_events","type":"User","site_admin":false},"body":"For [JAVA-1355](https://datastax-oss.atlassian.net/browse/JAVA-1355):\r\n\r\nMotivation:\r\n\r\nMetadata.getReplicas(String, TokenRange) currently assumes that the\r\nTokenRange provided represents a TokenRange for a single host.  Because\r\nof this, it finds the replicas for the last Token on that range instead\r\nof considering the entire range.\r\n\r\nArbitrary TokenRanges may be provided that span multiple hosts.  In\r\nthis case, this method should include each host spanning this range\r\nand their replicas.\r\n\r\nModifications:\r\n\r\nUpdated method to evaluate which Host's TokenRanges intersect with the\r\ninput TokenRange and include those range's replicas.\r\n\r\nResult:\r\n\r\nMetadata.getReplicas(String TokenRange) now includes replicas for all\r\nhosts covering a range, not just the replicas for the last token in the\r\nrange.\r\n\r\nTargeted this against 3.0.x & 3.0.6, but wasn't sure if that was appropriate.  It could also be debated as to whether this is a bug fix or a functionality change, which could effect what target release could be.  If we decide to leave as is, I think it would be good to update the javadoc to make it clear that the method assumes the range only covers 1 host.","created_at":"2016-12-22T19:50:00Z","updated_at":"2016-12-22T19:50:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"70258651c911c6a92913f51ddd4eb95fc5c569df","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/datastax/java-driver/pulls/777/commits","review_comments_url":"https://api.github.com/repos/datastax/java-driver/pulls/777/comments","review_comment_url":"https://api.github.com/repos/datastax/java-driver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/datastax/java-driver/issues/777/comments","statuses_url":"https://api.github.com/repos/datastax/java-driver/statuses/118895aa46a208c95621ad82a4a5ded781013499","head":{"label":"datastax:java1355","ref":"java1355","sha":"118895aa46a208c95621ad82a4a5ded781013499","user":{"login":"datastax","id":573369,"avatar_url":"https://avatars.githubusercontent.com/u/573369?v=3","gravatar_id":"","url":"https://api.github.com/users/datastax","html_url":"https://github.com/datastax","followers_url":"https://api.github.com/users/datastax/followers","following_url":"https://api.github.com/users/datastax/following{/other_user}","gists_url":"https://api.github.com/users/datastax/gists{/gist_id}","starred_url":"https://api.github.com/users/datastax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datastax/subscriptions","organizations_url":"https://api.github.com/users/datastax/orgs","repos_url":"https://api.github.com/users/datastax/repos","events_url":"https://api.github.com/users/datastax/events{/privacy}","received_events_url":"https://api.github.com/users/datastax/received_events","type":"Organization","site_admin":false},"repo":{"id":6765281,"name":"java-driver","full_name":"datastax/java-driver","owner":{"login":"datastax","id":573369,"avatar_url":"https://avatars.githubusercontent.com/u/573369?v=3","gravatar_id":"","url":"https://api.github.com/users/datastax","html_url":"https://github.com/datastax","followers_url":"https://api.github.com/users/datastax/followers","following_url":"https://api.github.com/users/datastax/following{/other_user}","gists_url":"https://api.github.com/users/datastax/gists{/gist_id}","starred_url":"https://api.github.com/users/datastax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datastax/subscriptions","organizations_url":"https://api.github.com/users/datastax/orgs","repos_url":"https://api.github.com/users/datastax/repos","events_url":"https://api.github.com/users/datastax/events{/privacy}","received_events_url":"https://api.github.com/users/datastax/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/datastax/java-driver","description":"DataStax Java Driver for Apache Cassandra","fork":false,"url":"https://api.github.com/repos/datastax/java-driver","forks_url":"https://api.github.com/repos/datastax/java-driver/forks","keys_url":"https://api.github.com/repos/datastax/java-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datastax/java-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datastax/java-driver/teams","hooks_url":"https://api.github.com/repos/datastax/java-driver/hooks","issue_events_url":"https://api.github.com/repos/datastax/java-driver/issues/events{/number}","events_url":"https://api.github.com/repos/datastax/java-driver/events","assignees_url":"https://api.github.com/repos/datastax/java-driver/assignees{/user}","branches_url":"https://api.github.com/repos/datastax/java-driver/branches{/branch}","tags_url":"https://api.github.com/repos/datastax/java-driver/tags","blobs_url":"https://api.github.com/repos/datastax/java-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datastax/java-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datastax/java-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/datastax/java-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datastax/java-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/datastax/java-driver/languages","stargazers_url":"https://api.github.com/repos/datastax/java-driver/stargazers","contributors_url":"https://api.github.com/repos/datastax/java-driver/contributors","subscribers_url":"https://api.github.com/repos/datastax/java-driver/subscribers","subscription_url":"https://api.github.com/repos/datastax/java-driver/subscription","commits_url":"https://api.github.com/repos/datastax/java-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/datastax/java-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/datastax/java-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/datastax/java-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/datastax/java-driver/contents/{+path}","compare_url":"https://api.github.com/repos/datastax/java-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datastax/java-driver/merges","archive_url":"https://api.github.com/repos/datastax/java-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datastax/java-driver/downloads","issues_url":"https://api.github.com/repos/datastax/java-driver/issues{/number}","pulls_url":"https://api.github.com/repos/datastax/java-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/datastax/java-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/datastax/java-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datastax/java-driver/labels{/name}","releases_url":"https://api.github.com/repos/datastax/java-driver/releases{/id}","deployments_url":"https://api.github.com/repos/datastax/java-driver/deployments","created_at":"2012-11-19T18:44:41Z","updated_at":"2016-12-19T20:45:45Z","pushed_at":"2016-12-22T19:50:01Z","git_url":"git://github.com/datastax/java-driver.git","ssh_url":"git@github.com:datastax/java-driver.git","clone_url":"https://github.com/datastax/java-driver.git","svn_url":"https://github.com/datastax/java-driver","homepage":null,"size":23020,"stargazers_count":729,"watchers_count":729,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":530,"mirror_url":null,"open_issues_count":34,"forks":530,"open_issues":34,"watchers":729,"default_branch":"3.x"}},"base":{"label":"datastax:3.0.x","ref":"3.0.x","sha":"e08995220d5f0110319a89f073eade46aee2462d","user":{"login":"datastax","id":573369,"avatar_url":"https://avatars.githubusercontent.com/u/573369?v=3","gravatar_id":"","url":"https://api.github.com/users/datastax","html_url":"https://github.com/datastax","followers_url":"https://api.github.com/users/datastax/followers","following_url":"https://api.github.com/users/datastax/following{/other_user}","gists_url":"https://api.github.com/users/datastax/gists{/gist_id}","starred_url":"https://api.github.com/users/datastax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datastax/subscriptions","organizations_url":"https://api.github.com/users/datastax/orgs","repos_url":"https://api.github.com/users/datastax/repos","events_url":"https://api.github.com/users/datastax/events{/privacy}","received_events_url":"https://api.github.com/users/datastax/received_events","type":"Organization","site_admin":false},"repo":{"id":6765281,"name":"java-driver","full_name":"datastax/java-driver","owner":{"login":"datastax","id":573369,"avatar_url":"https://avatars.githubusercontent.com/u/573369?v=3","gravatar_id":"","url":"https://api.github.com/users/datastax","html_url":"https://github.com/datastax","followers_url":"https://api.github.com/users/datastax/followers","following_url":"https://api.github.com/users/datastax/following{/other_user}","gists_url":"https://api.github.com/users/datastax/gists{/gist_id}","starred_url":"https://api.github.com/users/datastax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datastax/subscriptions","organizations_url":"https://api.github.com/users/datastax/orgs","repos_url":"https://api.github.com/users/datastax/repos","events_url":"https://api.github.com/users/datastax/events{/privacy}","received_events_url":"https://api.github.com/users/datastax/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/datastax/java-driver","description":"DataStax Java Driver for Apache Cassandra","fork":false,"url":"https://api.github.com/repos/datastax/java-driver","forks_url":"https://api.github.com/repos/datastax/java-driver/forks","keys_url":"https://api.github.com/repos/datastax/java-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datastax/java-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datastax/java-driver/teams","hooks_url":"https://api.github.com/repos/datastax/java-driver/hooks","issue_events_url":"https://api.github.com/repos/datastax/java-driver/issues/events{/number}","events_url":"https://api.github.com/repos/datastax/java-driver/events","assignees_url":"https://api.github.com/repos/datastax/java-driver/assignees{/user}","branches_url":"https://api.github.com/repos/datastax/java-driver/branches{/branch}","tags_url":"https://api.github.com/repos/datastax/java-driver/tags","blobs_url":"https://api.github.com/repos/datastax/java-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datastax/java-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datastax/java-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/datastax/java-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datastax/java-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/datastax/java-driver/languages","stargazers_url":"https://api.github.com/repos/datastax/java-driver/stargazers","contributors_url":"https://api.github.com/repos/datastax/java-driver/contributors","subscribers_url":"https://api.github.com/repos/datastax/java-driver/subscribers","subscription_url":"https://api.github.com/repos/datastax/java-driver/subscription","commits_url":"https://api.github.com/repos/datastax/java-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/datastax/java-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/datastax/java-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/datastax/java-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/datastax/java-driver/contents/{+path}","compare_url":"https://api.github.com/repos/datastax/java-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datastax/java-driver/merges","archive_url":"https://api.github.com/repos/datastax/java-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datastax/java-driver/downloads","issues_url":"https://api.github.com/repos/datastax/java-driver/issues{/number}","pulls_url":"https://api.github.com/repos/datastax/java-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/datastax/java-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/datastax/java-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datastax/java-driver/labels{/name}","releases_url":"https://api.github.com/repos/datastax/java-driver/releases{/id}","deployments_url":"https://api.github.com/repos/datastax/java-driver/deployments","created_at":"2012-11-19T18:44:41Z","updated_at":"2016-12-19T20:45:45Z","pushed_at":"2016-12-22T19:50:01Z","git_url":"git://github.com/datastax/java-driver.git","ssh_url":"git@github.com:datastax/java-driver.git","clone_url":"https://github.com/datastax/java-driver.git","svn_url":"https://github.com/datastax/java-driver","homepage":null,"size":23020,"stargazers_count":729,"watchers_count":729,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":530,"mirror_url":null,"open_issues_count":34,"forks":530,"open_issues":34,"watchers":729,"default_branch":"3.x"}},"_links":{"self":{"href":"https://api.github.com/repos/datastax/java-driver/pulls/777"},"html":{"href":"https://github.com/datastax/java-driver/pull/777"},"issue":{"href":"https://api.github.com/repos/datastax/java-driver/issues/777"},"comments":{"href":"https://api.github.com/repos/datastax/java-driver/issues/777/comments"},"review_comments":{"href":"https://api.github.com/repos/datastax/java-driver/pulls/777/comments"},"review_comment":{"href":"https://api.github.com/repos/datastax/java-driver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/datastax/java-driver/pulls/777/commits"},"statuses":{"href":"https://api.github.com/repos/datastax/java-driver/statuses/118895aa46a208c95621ad82a4a5ded781013499"}}}}
{"actor":{"display_login":"tolbertam"}}